Allow intrinsics.procedure_of on procedures without results or requiring a context; treat a specialized procedure's type as concrete

This commit is contained in:
gingerBill committed 2026-10-02 17:10:03 +01:00
1 parent f0ac6c3fba
commit 1d3f982b50
12 files changed
+218 -10

No files matched your search

+11
View File
@@ -2609,6 +2609,9 @@ gb_internal bool is_type_polymorphic(Type *t, bool or_specialized=false) {
break;
case Type_Proc:
if (t->Proc.is_poly_specialized) {
return or_specialized;
}
if (t->Proc.is_polymorphic) {
return true;
}
@@ -2680,6 +2683,14 @@ gb_internal bool is_type_polymorphic(Type *t, bool or_specialized=false) {
return false;
}
// e.g. to name a procedure after its specialization
gb_internal bool is_type_polymorphic_or_specialized_proc(Type *t) {
if (t != nullptr && t->kind == Type_Proc && t->Proc.is_poly_specialized) {
return true;
}
return is_type_polymorphic(t);
}
gb_internal bool type_has_nil(Type *t) {
t = base_type(t);