From aa2bb6b53ae9ddd3ae3f2516c308afeb1e1fa5c8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Sat, 3 Apr 2021 02:13:27 +0200 Subject: [PATCH] :art: More on errors --- src/parse/check.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/parse/check.c b/src/parse/check.c index 841dbb35..37d91b10 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -46,11 +46,12 @@ ANN m_bool check_subscripts(Env env, const Array_Sub array, const m_bool is_decl ANN static inline m_bool check_exp_decl_parent(const Env env, const Var_Decl var) { const Value value = find_value(env->class_def->info->parent, var->xid); - if(value) - ERR_B(var->pos, - _("in class '%s': '%s' has already been defined in parent class '%s' ..."), - env->class_def->name, s_name(var->xid), - value->from->owner_class ? value->from->owner_class->name : "?") + if(value) { + env_err(env, var->pos, + _("Value defined in parent class")); + gwerr_secondary(_("defined here"), value->from->filename, value->from->loc); + return GW_ERROR; + } return GW_OK; } @@ -1385,7 +1386,7 @@ ANN m_bool check_abstract(const Env env, const Class_Def cdef) { env->context->error = true; } } - return GW_OK; + return !err ? GW_OK : GW_ERROR; } ANN m_bool check_class_def(const Env env, const Class_Def cdef) { -- 2.43.0