From ed33871a03caa01c254ad9bccc9f22eeb1bddbf2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Sat, 19 Jun 2021 21:26:33 +0200 Subject: [PATCH] :bug: Fix enum shadowing --- src/parse/scan1.c | 2 ++ 1 file changed, 2 insertions(+) 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) { -- 2.43.0