]> Nishi Git Mirror - gwion.git/commitdiff
:bug: clean filename and stuff in scan_type
authorfennecdjay <fennecdjay@gmail.com>
Sat, 3 Dec 2022 17:51:08 +0000 (18:51 +0100)
committerfennecdjay <fennecdjay@gmail.com>
Sat, 3 Dec 2022 17:51:08 +0000 (18:51 +0100)
src/parse/template.c

index fbca7972bf8921339f3db85a4ada99272519c181..20b0daab5a1ed24e84470e6cedd9f20142336a81 100644 (file)
@@ -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);
   }