using Foo :: enum {A, B, C}; len(Foo)

This commit is contained in:
gingerBill
2018-07-29 10:50:15 +01:00
parent 49f2124df0
commit 6512a3e5f2
11 changed files with 60 additions and 73 deletions
+8
View File
@@ -2121,6 +2121,14 @@ void check_collect_value_decl(CheckerContext *c, Ast *decl) {
}
e->identifier = name;
if (vd->is_using) {
if (e->kind == Entity_TypeName && init->kind == Ast_EnumType) {
init->EnumType.is_using = true;
} else {
error(name, "'using' is not allowed on this constant value declaration");
}
}
if (e->kind != Entity_Procedure) {
if (fl != nullptr || c->foreign_context.in_export) {
AstKind kind = init->kind;