From: fennecdjay Date: Mon, 18 Jul 2022 14:17:25 +0000 (+0200) Subject: :art: Use type's filename in scan_class X-Git-Tag: nightly~264^2~90 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=9373f07c1a6dbc02fba12112323c86006cd1299d;p=gwion.git :art: Use type's filename in scan_class --- 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;