Prove cross-package application composition through public capabilities (WI-15)
This commit is contained in:
@@ -192,8 +192,8 @@ 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");
|
||||
if (req.receiver === "input" && remote)
|
||||
throw new PortableBindingError(path, "Reference-selected dependencies require portable execution");
|
||||
return method(
|
||||
`${member.displayName}.${op.displayName}`,
|
||||
{ kind: "interface", operationId: op.id },
|
||||
|
||||
@@ -68,14 +68,11 @@ export function validateExecutionContracts(workspace: WorkspaceRevision): Capabi
|
||||
const selected = requirement.operations;
|
||||
if (requirement.receiver === "input") {
|
||||
if (!entry.execution || entry.execution.kind === "remote" || !selected?.length)
|
||||
fail(
|
||||
portPath,
|
||||
"Reference-selected reads require a portable snapshot or transaction and an explicit selection",
|
||||
);
|
||||
fail(portPath, "Reference-selected calls require portable execution and an explicit selection");
|
||||
for (const id of selected ?? []) {
|
||||
const operation = contract && operations(id, contract);
|
||||
if (operation?.execution?.kind !== "snapshot" || operation.scope === "class")
|
||||
fail(portPath, "Reference-selected dependencies currently support object snapshot operations only");
|
||||
if (!operation?.execution || operation.execution.kind === "remote" || operation.scope === "class")
|
||||
fail(portPath, "Reference-selected dependencies require portable object operations");
|
||||
}
|
||||
}
|
||||
if (selected && (!selected.length || new Set(selected).size !== selected.length))
|
||||
|
||||
Reference in New Issue
Block a user