From c3a8e232a556fd60aa62aaa1273d4bcc779e80f4 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 18 Jan 2020 11:27:41 +0000 Subject: Add new intrinsics for polymorphic records: type_is_specialized_polymorphic_record, type_is_unspecialized_polymorphic_record, type_polymorphic_record_parameter_count, type_polymorphic_record_parameter_value --- src/types.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/types.cpp') diff --git a/src/types.cpp b/src/types.cpp index cf8e603ba..e120c77c0 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -1471,11 +1471,12 @@ Scope *polymorphic_record_parent_scope(Type *t) { } bool is_type_polymorphic_record_specialized(Type *t) { + Type *original_type = t; t = base_type(t); if (t->kind == Type_Struct) { - return t->Struct.is_polymorphic && t->Struct.is_poly_specialized; + return t->Struct.is_poly_specialized; } else if (t->kind == Type_Union) { - return t->Union.is_polymorphic && t->Union.is_poly_specialized; + return t->Union.is_poly_specialized; } return false; } -- cgit v1.2.3