diff --git a/src/types.cpp b/src/types.cpp index 0e41b1b9b..1de7e2a07 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -2824,6 +2824,10 @@ gb_internal bool is_type_comparable(Type *t) { if (t->Struct.soa_kind != StructSoa_None) { return false; } + // an unspecialized polymorphic record has no values to compare + if (is_type_polymorphic_record_unspecialized(t)) { + return false; + } if (t->Struct.is_raw_union) { return is_type_simple_compare(t); }