aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
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);