Allow for CONSTANT_TYPEID_ARRAY[idx] to be used as a type in certain contexts

This commit is contained in:
gingerBill
2026-01-26 19:31:37 +00:00
parent 27bd72c18a
commit 7bdd0a80ca

View File

@@ -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;