aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2019-12-27 13:55:18 +0000
committergingerBill <bill@gingerbill.org>2019-12-27 13:55:18 +0000
commit880c7f01a8ee71f9001ad7d9558753cf8d512845 (patch)
tree647119090edcc7df800bccc8f264bf2604fa51db /src/check_type.cpp
parent10f0961184a5f486bad2050d1bb42320b833a370 (diff)
Fix array lengths with enum value counts.
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index 0b7843993..bdb5f048b 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -3234,7 +3234,7 @@ bool check_type_internal(CheckerContext *ctx, Ast *e, Type **type, Type *named_t
if (o.mode == Addressing_Type && o.type->kind == Type_Generic) {
generic_type = o.type;
- } else if (is_type_enum(o.type)) {
+ } else if (o.mode == Addressing_Type && is_type_enum(o.type)) {
Type *index = o.type;
Type *bt = base_type(index);
GB_ASSERT(bt->kind == Type_Enum);