From 880c7f01a8ee71f9001ad7d9558753cf8d512845 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Fri, 27 Dec 2019 13:55:18 +0000 Subject: Fix array lengths with enum value counts. --- src/check_type.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/check_type.cpp') 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); -- cgit v1.2.3