From: fennecdjay Date: Mon, 7 Oct 2019 19:32:50 +0000 (+0200) Subject: :bug: Fix fptr import X-Git-Tag: nightly~2198^2~129 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=789bdae88c4784943f3ea0e037ec742451c29b01;p=gwion.git :bug: Fix fptr import --- diff --git a/src/parse/scan0.c b/src/parse/scan0.c index 2f5e096a..1e7c88ee 100644 --- a/src/parse/scan0.c +++ b/src/parse/scan0.c @@ -91,7 +91,7 @@ ANN m_bool scan0_fptr_def(const Env env, const Fptr_Def fptr) { const Type t = scan0_type(env, env->gwion->type[et_fptr]->xid, name, env->gwion->type[et_fptr]); t->e->owner = !(!env->class_def && GET_FLAG(fptr->base->td, global)) ? env->curr : env->global_nspc; - if(GET_FLAG(fptr->base->td, global)) + if(GET_FLAG(fptr->base->td, global) && env->context) env->context->global = 1; t->nspc = new_nspc(env->gwion->mp, name); t->flag = fptr->base->td->flag;