From: Jérémie Astor Date: Sat, 19 Jun 2021 19:26:33 +0000 (+0200) Subject: :bug: Fix enum shadowing X-Git-Tag: nightly~579 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=ed33871a03caa01c254ad9bccc9f22eeb1bddbf2;p=gwion.git :bug: Fix enum shadowing --- diff --git a/src/parse/scan1.c b/src/parse/scan1.c index 4ee0a60a..4a812bb1 100644 --- a/src/parse/scan1.c +++ b/src/parse/scan1.c @@ -365,6 +365,8 @@ ANN m_bool scan1_enum_def(const Env env, const Enum_Def edef) { ID_List list = edef->list; do { CHECK_BB(already_defined(env, list->xid, edef->pos)); + if(nspc_lookup_value1(edef->t->info->value->from->owner, list->xid)) + ERR_B(edef->pos, "'%s' already defined", s_name(list->xid)); const Value v = new_value(env->gwion->mp, edef->t, s_name(list->xid)); valuefrom(env, v->from, edef->pos); if (env->class_def) {