Support explicitly reference-selected read-only interface dependencies

This commit is contained in:
Timothy J. Aveni
2026-09-20 22:15:15 -07:00
parent 266d2d98d0
commit c0669d2ed8
12 changed files with 1081 additions and 893 deletions
+14 -1
View File
@@ -183,10 +183,23 @@ function methods(
`Selected operation is not an object call available in portable target ${target}; select a portable subset or move this handler to remote execution`,
);
if (execution.kind === "transaction" && !remote) writable();
if (req.receiver === "input" && (remote || execution.kind !== "snapshot"))
throw new PortableBindingError(path, "Reference-selected dependencies require portable snapshot calls");
return method(
`${member.displayName}.${op.displayName}`,
{ kind: "interface", operationId: op.id },
op.inputType,
req.receiver === "input"
? {
kind: "record",
fields: {
receiver: {
kind: "object-ref",
expectation: { kind: "interface", interfaceRevisionId: req.interfaceRevisionId },
},
input: op.inputType,
},
}
: op.inputType,
op.outputType,
execution.kind === "transaction",
);