Disallow using on an enum declaration.

This commit is contained in:
gingerBill
2021-08-05 17:46:42 +01:00
parent dd8fa1d690
commit 0d257c61cd
3 changed files with 21 additions and 20 deletions

View File

@@ -294,6 +294,8 @@ void check_type_decl(CheckerContext *ctx, Entity *e, Ast *init_expr, Type *def)
// using decl
if (decl->is_using) {
warning(init_expr, "'using' an enum declaration is not allowed, prefer using implicit selector expressions e.g. '.A'");
#if 0
// NOTE(bill): Must be an enum declaration
if (te->kind == Ast_EnumType) {
Scope *parent = e->scope;
@@ -317,6 +319,7 @@ void check_type_decl(CheckerContext *ctx, Entity *e, Ast *init_expr, Type *def)
}
}
}
#endif
}
}