From 7bdd0a80caed77ea27907b380788b6e764b81364 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 26 Jan 2026 19:31:37 +0000 Subject: Allow for `CONSTANT_TYPEID_ARRAY[idx]` to be used as a type in certain contexts --- src/check_type.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/check_type.cpp') 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; -- cgit v1.2.3