Support checked closed generic portable bindings

This commit is contained in:
Timothy J. Aveni
2026-09-20 19:47:10 -07:00
parent 74a16d3646
commit d701464312
5 changed files with 135 additions and 5 deletions
+4 -5
View File
@@ -210,11 +210,10 @@ export function generatePortableTypeScriptBindings(
adapters: string[] = [],
descriptors: unknown[] = [];
for (const entry of entries) {
if (entry.application || entry.kind === "constructor")
throw new PortableBindingError(
entry.id,
"Portable generic adapters/legacy constructors are not implemented; declare an ordinary factory",
);
// The checked binding schema already contains concrete generic applications.
// Each has its own identity, value codecs and specialized dependency ports.
if (entry.kind === "constructor")
throw new PortableBindingError(entry.id, "Legacy constructors are not supported; declare an ordinary factory");
if (names.has(entry.displayName)) throw new PortableBindingError(entry.id, "Duplicate handler name");
names.add(entry.displayName);
const portNames = new Set<string>();