Support explicitly reference-selected read-only interface dependencies
This commit is contained in:
@@ -1418,6 +1418,15 @@ const validateBoundDependencies = (
|
||||
}
|
||||
case "interface": {
|
||||
const interfaceBinding = binding as Extract<DependencyBinding, { kind: "interface" }>;
|
||||
if (interfaceBinding.receiver !== requirement.receiver || (interfaceBinding.receiver && interfaceBinding.via)) {
|
||||
issue(
|
||||
issues,
|
||||
"invalid-dependency-binding",
|
||||
path,
|
||||
"Reference-selected interface ports require an explicit matching from input binding",
|
||||
);
|
||||
break;
|
||||
}
|
||||
if (interfaceBinding.interfaceRevisionId !== requirement.interfaceRevisionId) {
|
||||
issue(
|
||||
issues,
|
||||
@@ -1427,6 +1436,9 @@ const validateBoundDependencies = (
|
||||
);
|
||||
break;
|
||||
}
|
||||
// The reference supplies its own checked witness at invocation time.
|
||||
// This is not a requirement that the current receiver implements the interface.
|
||||
if (interfaceBinding.receiver === "input") break;
|
||||
const traversal = interfaceBinding.via
|
||||
? validateTraversal(
|
||||
issues,
|
||||
|
||||
Reference in New Issue
Block a user