aboutsummaryrefslogtreecommitdiff
path: root/src/types.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-05-09 10:58:57 +0100
committergingerBill <bill@gingerbill.org>2024-05-09 10:58:57 +0100
commitd85c8f0b2c5989f7d14b02c9023060990d241111 (patch)
treeacbd8ff0cc3f6d18d741a309e03aacdca8c08deb /src/types.cpp
parent97e9c50d116024901ce029c495495fd723cedf7f (diff)
Fix #3555
Diffstat (limited to 'src/types.cpp')
-rw-r--r--src/types.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/types.cpp b/src/types.cpp
index 3ec05059f..30e009086 100644
--- a/src/types.cpp
+++ b/src/types.cpp
@@ -3267,6 +3267,10 @@ gb_internal Selection lookup_field_with_selection(Type *type_, String field_name
}
}
+ if (is_type_polymorphic(type)) {
+ // NOTE(bill): A polymorphic struct has no fields, this only hits in the case of an error
+ return sel;
+ }
wait_signal_until_available(&type->Struct.fields_wait_signal);
isize field_count = type->Struct.fields.count;
if (field_count != 0) for_array(i, type->Struct.fields) {