aboutsummaryrefslogtreecommitdiff
path: root/src/checker.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-07-29 10:50:15 +0100
committergingerBill <bill@gingerbill.org>2018-07-29 10:50:15 +0100
commit6512a3e5f24a3aecb1451f921455a93231412104 (patch)
treee784404bf3ad291c54314e9ab9690e9bd9da754f /src/checker.cpp
parent49f2124df0f644e183f0570dd047493678eaf9f1 (diff)
using Foo :: enum {A, B, C}; len(Foo)
Diffstat (limited to 'src/checker.cpp')
-rw-r--r--src/checker.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/checker.cpp b/src/checker.cpp
index 58ba4aa68..9f59788b8 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -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;