From 7f93f816cbc24f85bc536b39c3211c433beb2dda Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Fri, 13 Aug 2021 20:49:38 +0200 Subject: [PATCH] :bug: :art: fix global lambds --- src/lib/lib_func.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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) { -- 2.43.0