aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2023-10-06 15:06:40 +0100
committerGitHub <noreply@github.com>2023-10-06 15:06:40 +0100
commit96778c69bcb6feebd92009c32f89aed2d52cb802 (patch)
treebbfb4f8ee3a356565072885734892e14db928bc0 /src/check_type.cpp
parent2cca00505601f0b0e76719d366a037cdb4cf794c (diff)
parent394c12f68dc380aea93ad447f5f348383811d09f (diff)
Merge pull request #2836 from jakubtomsu/fix-zero-length-enum-array
Allow zero-length enum array (to stay consistent with `[0]T`)
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 a43c296a6..d66b196bc 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -2797,7 +2797,7 @@ gb_internal bool check_type_internal(CheckerContext *ctx, Ast *e, Type **type, T
Type *bt = base_type(index);
GB_ASSERT(bt->kind == Type_Enum);
- Type *t = alloc_type_enumerated_array(elem, index, bt->Enum.min_value, bt->Enum.max_value, Token_Invalid);
+ Type *t = alloc_type_enumerated_array(elem, index, bt->Enum.min_value, bt->Enum.max_value, bt->Enum.fields.count, Token_Invalid);
bool is_sparse = false;
if (at->tag != nullptr) {