From ac1f32efa0d0a6cdb3524e223429e37ff2b213d1 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Sat, 3 Dec 2022 18:51:08 +0100 Subject: [PATCH] :bug: clean filename and stuff in scan_type --- src/parse/template.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); } -- 2.43.0