aboutsummaryrefslogtreecommitdiff
path: root/src/types.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-01-18 11:27:41 +0000
committergingerBill <bill@gingerbill.org>2020-01-18 11:27:41 +0000
commitc3a8e232a556fd60aa62aaa1273d4bcc779e80f4 (patch)
treec0060f945ee6fd804be4825f736db55287ff902f /src/types.cpp
parent7f89f6b582b138f9809d80f7ed133d72c248f56d (diff)
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
Diffstat (limited to 'src/types.cpp')
-rw-r--r--src/types.cpp5
1 files changed, 3 insertions, 2 deletions
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;
}