From: Jérémie Astor Date: Wed, 11 May 2022 18:32:51 +0000 (+0200) Subject: :bug: Fix signature's storage X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=1e347817dc39c6a4df44aa5cf888819a554360b0;p=gwion.git :bug: Fix signature's storage --- diff --git a/src/parse/type_decl.c b/src/parse/type_decl.c index 2106ba7d..d77a7c41 100644 --- a/src/parse/type_decl.c +++ b/src/parse/type_decl.c @@ -73,15 +73,15 @@ ANN static Symbol symname(const Env env, Func_Base *const base, bool *global) { ANN static inline Type find(const Env env, Type_Decl *td) { if (!td->fptr) return find_type(env, td); - bool global; + bool global = false; CHECK_OO((td->xid = symname(env, td->fptr->base, &global))); const Fptr_Def fptr = td->fptr; td->fptr = NULL; const Type exists = find_type(env, td); if(exists) return exists; - const m_uint scope = !global - ? env_push_global(env) - : env_push(env, NULL, env->context->nspc); + const m_uint scope = env->context + ? env_push(env, NULL, env->context->nspc) + : env_push_global(env); const m_bool ret = traverse_fptr_def(env, fptr); env_pop(env, scope); const Type t = fptr->type;