ANN static void check(struct EnvSet *es, const Type t) {
es->_ctx = es->env->context;
es->_filename = es->env->name;
+ if(!type_global(es->env, t)) // why need value?
+ es->env->name = t->info->value->from->filename;
const Vector v = &es->env->scope->class_stack;
Type owner = t->info->value->from->owner_class;
for (vtype i = vector_size(v) + 1; owner && --i;) {
const m_str tmpl_name) {
const TmplArg_List types = exp->tmpl->call;
const Func former = env->func;
+ const m_uint scope = env->scope->depth;
struct EnvSet es = {.env = env,
.data = env,
.func = (_envset_func)check_cdef,
- .scope = env->scope->depth,
+ .scope = scope,
.flag = tflag_check};
struct ResolverArgs ra = {
.v = v, .e = exp, .tmpl_name = tmpl_name, .types = types};
- CHECK_O(envset_pushf(&es, v));
+ CHECK_O(envset_pushv(&es, v));
+ (void)env_push(env, v->from->owner_class, v->from->owner);
const Tmpl *tmpl = v->from->owner_class && v->from->owner_class->info->cdef ?
get_tmpl(v->from->owner_class) : NULL;
if(tmpl)
: fptr_match(env, &ra);
if(tmpl)
nspc_pop_type(env->gwion->mp, env->curr);
- envset_popf(&es, v);
+ env_pop(env, scope);
+ envset_pop(&es, v->from->owner_class);
env->func = former;
return m_func;
}
}
ANN static bool scan1_stmt_pp(const Env env, const Stmt_PP stmt) {
- if (stmt->pp_type == ae_pp_include) env->name = stmt->data;
+ if (stmt->pp_type == ae_pp_include)
+ env->name = stmt->data;
if (stmt->pp_type == ae_pp_pragma && !strcmp(stmt->data, "packed")) {
if(env->class_def && !tflag(env->class_def, tflag_union)) set_tflag(env->class_def, tflag_packed);
else ERR_B(stmt_self(stmt)->loc, "`packed` pragma outside of {G+}class{0} or {G+}struct{0} declaration");