From f78b380b71b63e93de5b938662403d902f601738 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Wed, 19 Aug 2026 16:47:46 +0500 Subject: [PATCH] express/mapping: fix breaking generation after f23db9440fd It was failing to map `int64_t` to `Argument_INT` enum. --- .../ifcopenshell/express/mapping.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/express/mapping.py b/src/ifcopenshell-python/ifcopenshell/express/mapping.py index 7eb32a15e0..75c3fab302 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/mapping.py +++ b/src/ifcopenshell-python/ifcopenshell/express/mapping.py @@ -41,6 +41,15 @@ class Mapping: "binary": "boost::dynamic_bitset<>", } + cpp_to_argument_types = { + "boolean": "BOOL", + "logical": "LOGICAL", + "integer": "INT", + "real": "DOUBLE", + "number": "DOUBLE", + "string": "STRING", + } + supported_argument_types = set( [ "INT", @@ -139,8 +148,8 @@ class Mapping: if ty == "UNKNOWN": return "UNKNOWN" return "AGGREGATE_OF_" + ty - elif str(type) in self.express_to_cpp_typemapping: - return self.express_to_cpp_typemapping.get(str(type), type).split("::")[-1].upper() + elif (ty := self.cpp_to_argument_types.get(str(type))) is not None: + return ty elif self.schema.is_type(type): return _make_argument_type(self.schema.types[type].type) else: