From 9373f07c1a6dbc02fba12112323c86006cd1299d Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Mon, 18 Jul 2022 16:17:25 +0200 Subject: [PATCH] :art: Use type's filename in scan_class --- src/lib/object_op.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib/object_op.c b/src/lib/object_op.c index e1087dd8..50f814cb 100644 --- a/src/lib/object_op.c +++ b/src/lib/object_op.c @@ -359,7 +359,15 @@ ANN Type scan_class(const Env env, const Type t, const Type_Decl *td) { CHECK_BO(envset_pushv(&es, t->info->value)); const bool local = !owner && !tmpl_global(env, td->types) && from_global_nspc(env, env->curr); if(local)env_push(env, NULL, env->context->nspc); + // these context and env command may fit better somewhere else + const m_str env_filename = env->name; + const m_str ctx_filename = env->context->name; + env->name = t->info->value->from->filename; + env->context->name = t->info->value->from->ctx->name; + env->context->name = ctx_filename; const Type ret = _scan_class(env, &info); + env->name = env_filename; + env->context->name = ctx_filename; if(local)env_pop(env, es.scope); if (es.run) envset_pop(&es, owner); return ret; -- 2.43.0