ANN Type find_type(const Env, Type_Decl *);
ANN void env_err(const Env, const loc_t, const m_str fmt, ...);
ANN void env_warn(const Env, const loc_t, const m_str fmt, ...);
-ANN void env_error_footer(const Env env);
ANN Value global_string(const Env env, const m_str str, const loc_t);
ANN void release_ctx(struct Env_Scope_ *a, struct Gwion_ *gwion);
if (!v || is_class(env->gwion, v->type)) return true;
gwerr_basic(_("already declared as variable"), NULL, NULL, env->name, loc, 0);
declared_here(v);
- env_error_footer(env);
return false;
}
mempool_end(gwion->mp);
}
-ANN void env_error_footer(const Env env) {
- bool ctor = false;
- if (env->func && env->func->def) {
- if(!is_ctor(env->func->def))
- gwerr_secondary("in function", env->name, env->func->def->base->tag.loc);
- else {
- gwerr_secondary("in class pre constructor", env->name,
- env->class_def->info->cdef->base.tag.loc);
- ctor = true;
- }
- }
- if (!ctor && env->class_def && tflag(env->class_def, tflag_cdef))
- gwerr_secondary("in class", env->name, env->class_def->info->cdef->base.tag.loc);
-}
-
ANN static void env_xxx(const Env env, const loc_t loc, const m_str fmt,
va_list arg) {
#ifndef __FUZZING__
char c[size + 1];
vsprintf(c, fmt, arg);
gwerr_basic(c, NULL, NULL, env->name, loc, 0);
- env_error_footer(env);
#endif
}
char c[size + 1];
vsprintf(c, fmt, arg);
gwerr_warn(c, NULL, NULL, env->name, loc);
- env_error_footer(env);
#endif
}
if (GET_FLAG(value, private)) {
gwerr_basic("invalid variable access", "is private", NULL, env->name,
exp->loc, 0);
- env_error_footer(env);
defined_here(value);
env_set_error(env, true);
return false;
ID_List list = cdef->traits;
if (!check_trait_requests(env, t, list, t->info->value->from)) {
env->class_def = t;
- env_error_footer(env);
env_set_error(env, true);
return false;
}