From 516a2f6af2651267bb234bbc2662ded213c8d715 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Sun, 28 Feb 2021 00:14:20 +0100 Subject: [PATCH] :art: Fix Array context --- src/lib/array.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/array.c b/src/lib/array.c index 67d29e9c..b0d4172b 100644 --- a/src/lib/array.c +++ b/src/lib/array.c @@ -443,11 +443,14 @@ static OP_CHECK(opck_array_scan) { cdef->base.xid = sym; cdef->base.tmpl->base = 1; // could store depth here? cdef->base.tmpl->call = new_type_list(env->gwion->mp, type2td(env->gwion, base, (loc_t){}), NULL); - const m_uint scope = env_push(env, NULL, base->info->owner); + const Context ctx = env->context; + env->context = base->info->ctx; + const m_uint scope = env_push(env, base->info->owner_class, base->info->owner); (void)scan0_class_def(env, cdef); const Type t = cdef->base.type; (void)traverse_cdef(env, t); env_pop(env, scope); + env->context = ctx; if(GET_FLAG(base, abstract)) SET_FLAG(t, abstract); else -- 2.43.0