From 59264435768fda459db60d3c948ca4cc1bd9a4ac Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 16 Nov 2026 19:29:25 +0100 Subject: [PATCH] Refuse a class over a type the catalog keeps out of the object layer tools/objectgen.py stops before emitting the types layer when a class of the catalog's object model wraps a C type whose typeEncodings entry carries bindingScope: host for the time types a binding casts to its language's own, none for numeric, box2d and box3d, which no binding carries. MEOS-API refuses such a class when it derives the catalog (check_scope_classes); the generator reads the same mark, so a catalog from another derivation cannot hand C# one. Witness. Over the catalog of MobilityDB master af86409853 with a leaf Numeric under Value and its class over NumericData added to the object model, the shape the catalog held before numeric left binding scope, objectgen exits 1 with "classes over types out of the object layer: Numeric (NumericData, bindingScope none)"; over that catalog as derived it emits 154 classes and 5191 methods, 0 deferred, and the generated tree equals main's. Why. The owner ruled the time types host types and numeric, box2d and box3d out of binding scope; the catalog states the ruling once, in bindingScope, and each generator reads it rather than a list of its own. Measured over the catalog of MobilityDB master af86409853 and MEOS-API master ea8305118a: tools/codegen.py and tools/objectgen.py leave MEOS.NET/ and GAP-LEDGER.md byte-identical to main. --- tools/objectgen.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/objectgen.py b/tools/objectgen.py index 2a55919..cd6ea64 100644 --- a/tools/objectgen.py +++ b/tools/objectgen.py @@ -2437,6 +2437,18 @@ def main() -> int: model = Model(idl) gen = Generator(model) + # A type the catalog marks bindingScope (host: the time types a binding + # casts to its language's own; none: a type no binding carries) has no + # class, as #check_scope_classes of MEOS-API refuses one in the model, so a + # class over one stops the generation rather than reaching the object layer. + encodings = idl.get("typeEncodings", {}) + scoped = sorted(f"{cls} ({model.ctype[cls]}, bindingScope " + f"{encodings[model.ctype[cls]]['bindingScope']})" + for cls in model.classes() + if encodings.get(model.ctype.get(cls), {}).get("bindingScope")) + if scoped: + sys.exit("objectgen: classes over types out of the object layer: " + + "; ".join(scoped)) repo_root = Path(__file__).resolve().parent.parent gen.run(repo_root / "MEOS.NET" / "Types") gen.run_errors(repo_root / "MEOS.NET" / "Errors",