From: Jérémie Astor Date: Fri, 13 Aug 2021 18:49:38 +0000 (+0200) Subject: :bug: :art: fix global lambds X-Git-Tag: nightly~470^2~91 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=7f93f816cbc24f85bc536b39c3211c433beb2dda;p=gwion.git :bug: :art: fix global lambds --- diff --git a/src/lib/lib_func.c b/src/lib/lib_func.c index d0a17d40..2ca87853 100644 --- a/src/lib/lib_func.c +++ b/src/lib/lib_func.c @@ -273,15 +273,15 @@ ANN static m_bool _check_lambda(const Env env, Exp_Lambda *l, UNSET_FLAG(l->def->base, global); l->def->base->values = env->curr->info->value; const m_uint scope = env->scope->depth; - // if(GET_FLAG(def->base, global) && !l->owner && - // def->base->func->value_ref->from->owner_class) - // env_push(env, NULL, env->context->nspc); + if(GET_FLAG(def->base, global) && !l->owner && + def->base->func->value_ref->from->owner_class) + env_push(env, NULL, env->context->nspc); env->scope->depth = 0; const m_bool ret = traverse_func_def(env, l->def); env->scope->depth = scope; - // if(GET_FLAG(def->base, global) && !l->owner && - // def->base->func->value_ref->from->owner_class) - // env_pop(env, scope); + if(GET_FLAG(def->base, global) && !l->owner && + def->base->func->value_ref->from->owner_class) + env_pop(env, scope); if (l->def->base->func) { if (env->curr->info->value != l->def->base->values) {