diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2026-01-26 19:31:37 +0000 |
|---|---|---|
| committer | gingerBill <gingerBill@users.noreply.github.com> | 2026-01-26 19:31:37 +0000 |
| commit | 7bdd0a80caed77ea27907b380788b6e764b81364 (patch) | |
| tree | 16b1ecdc8e428d95f2e4a4c4aee75b2d3573d952 /src/check_type.cpp | |
| parent | 27bd72c18a0c4ff36e8464df0232263a93a5372e (diff) | |
Allow for `CONSTANT_TYPEID_ARRAY[idx]` to be used as a type in certain contexts
Diffstat (limited to 'src/check_type.cpp')
| -rw-r--r-- | src/check_type.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp index af07efd8f..4b8f7b6ac 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -3750,6 +3750,20 @@ gb_internal bool check_type_internal(CheckerContext *ctx, Ast *e, Type **type, T set_base_type(named_type, *type); return true; case_end; + + default: { + Operand o = {}; + check_expr_base(ctx, &o, e, nullptr); + + if (o.mode == Addressing_Constant && + o.value.kind == ExactValue_Typeid) { + Type *t = o.value.value_typeid; + if (t != nullptr && t != t_invalid) { + *type = t; + return true; + } + } + } } *type = t_invalid; |