Support explicitly reference-selected read-only interface dependencies
This commit is contained in:
@@ -136,6 +136,7 @@ export function compileKernelProgram(plan: ExecutionPlan): unknown {
|
||||
...common,
|
||||
kind: "interface",
|
||||
interface: bound.interfaceRevisionId,
|
||||
...(bound.receiver ? { receiver: bound.receiver } : {}),
|
||||
operations: requirement.operations ?? iface.members.flatMap((m) => m.operations.map((o) => o.id)),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -162,6 +162,15 @@ export function compileExecutionPlan(input: WorkspaceRevision): ExecutionPlan {
|
||||
const queryOperations = (query: LinkedQuery) =>
|
||||
query.fields.map((f) => publicOperationKey(f.atomId, f.interfaceRevisionId, f.getter));
|
||||
const targetAtoms = (binding: DependencyBinding, atom: AtomId): AtomId[] => {
|
||||
if (binding.kind === "interface" && binding.receiver === "input")
|
||||
return workspace.atoms
|
||||
.filter((candidate) =>
|
||||
workspace.conformances.some(
|
||||
(conformance) =>
|
||||
conformance.atomId === candidate.id && conformance.interfaceRevisionId === binding.interfaceRevisionId,
|
||||
),
|
||||
)
|
||||
.map((candidate) => candidate.id);
|
||||
if (!("via" in binding) || !binding.via) return [atom];
|
||||
const edge = attachments.find((a) => a.id === binding.via!.edgeTypeId);
|
||||
if (!edge || edge.kind !== "edge") throw new ExecutionPlanError("MISSING_EDGE", atom, "Missing traversal edge");
|
||||
|
||||
Reference in New Issue
Block a user