From c72f960ed4eeb6d11feb9cb6c5e67ec84705f1ae Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Wed, 21 Jun 2023 14:21:08 +0200 Subject: [PATCH] #2805 statically typed select types as aggregates --- .../ifcopenshell/express/mapping.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/express/mapping.py b/src/ifcopenshell-python/ifcopenshell/express/mapping.py index a9ade4a9b3..7eecbb374d 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/mapping.py +++ b/src/ifcopenshell-python/ifcopenshell/express/mapping.py @@ -179,9 +179,13 @@ class Mapping: # We do not use pointers in aggregate_of. aggregate_of has member vector ty = ty.replace("*", "") - if self.schema.is_select(attr_type.type): - type_str = templates.untyped_list - elif self.schema.is_simpletype(ty) or str(ty) in self.express_to_cpp_typemapping.values(): + # https://github.com/IfcOpenShell/IfcOpenShell/issues/2805 + # This is no longer applicable, we do support statically typed select types as aggregates + # + # if self.schema.is_select(attr_type.type): + # type_str = templates.untyped_list + + if self.schema.is_simpletype(ty) or str(ty) in self.express_to_cpp_typemapping.values(): tmpl = templates.nested_array_type if is_nested_list else templates.array_type bounds = (attr_type.bounds.lower, attr_type.bounds.upper) if attr_type.bounds else (-1, -1) type_str = tmpl % {"instance_type": ty, "lower": bounds[0], "upper": bounds[1]}