]> Nishi Git Mirror - gwion.git/commitdiff
:art: Enums have unique type->xid
authorfennecdjay <astor.jeremie@wanadoo.fr>
Sat, 6 Apr 2019 07:29:38 +0000 (09:29 +0200)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Sat, 6 Apr 2019 07:29:38 +0000 (09:29 +0200)
src/parse/scan0.c

index 499dfd023568fa47145e17eebc4f5e9ce3da255b..89527c256fcaad49d9350a0fdee0220b78eaf946 100644 (file)
@@ -79,6 +79,7 @@ ANN m_bool scan0_stmt_enum(const Env env, const Stmt_Enum stmt) { GWDEBUG_EXE
     CHECK_BB(scan0_defined(env, stmt->xid, stmt->self->pos)) // test for type ?
   }
   const Type t = type_copy(env->gwion->p, t_int);
+  t->xid = ++env->scope->type_xid;
   t->name = stmt->xid ? s_name(stmt->xid) : "int";
   t->parent = t_int;
   const Nspc nspc = GET_FLAG(stmt, global) ? env->global_nspc : env->curr;