diff options
| author | gingerBill <bill@gingerbill.org> | 2021-08-05 17:46:42 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-08-05 17:46:42 +0100 |
| commit | 0d257c61cd28e1df7ea372e4f386483db2bf75d1 (patch) | |
| tree | 16e33e209eee289936cb33c29b9907ee1d6bef6f /src/check_decl.cpp | |
| parent | dd8fa1d690db5a6a42a300c1a09b821806ea39e8 (diff) | |
Disallow `using` on an enum declaration.
Diffstat (limited to 'src/check_decl.cpp')
| -rw-r--r-- | src/check_decl.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp index 2bf21c676..7e9ed0a1e 100644 --- a/src/check_decl.cpp +++ b/src/check_decl.cpp @@ -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 } } |