From: fennecdjay Date: Sat, 3 Dec 2022 17:51:08 +0000 (+0100) Subject: :bug: clean filename and stuff in scan_type X-Git-Tag: nightly~207^2~71 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=ac1f32efa0d0a6cdb3524e223429e37ff2b213d1;p=gwion.git :bug: clean filename and stuff in scan_type --- diff --git a/src/parse/template.c b/src/parse/template.c index fbca7972..20b0daab 100644 --- a/src/parse/template.c +++ b/src/parse/template.c @@ -205,11 +205,17 @@ ANN Type scan_type(const Env env, const Type t, Type_Decl *td) { .data = env, .scope = env->scope->depth, .flag = tflag_none}; - envset_pushv(&es, owner->info->value); + const Context ctx = env->context; + const m_str name = env->name; + envset_push(&es, owner, owner->nspc); (void)env_push(env, owner, owner->nspc); // TODO: is this needed? + env->context = owner->info->value->from->ctx; + env->name = owner->info->value->from->filename; const Type ret = known_type(env, td->next); env_pop(env, es.scope); envset_pop(&es, owner); + env->context = ctx; + env->name = name; if (!td->array) return ret; return array_type(env, ret, td->array->depth); }