Class AmbiguousCallArgumentsOrError

java.lang.Object
org.ek9lang.compiler.phase5.AmbiguousCallArgumentsOrError
All Implemented Interfaces:
Consumer<EK9Parser.ParamExpressionContext>

final class AmbiguousCallArgumentsOrError extends Object implements Consumer<EK9Parser.ParamExpressionContext>
Checks call sites for ambiguous positional arguments. Two rules are enforced:
  • Rule 12a (E11061): 2+ Boolean literal arguments require named arguments
  • Rule 12b (E11062): 4+ positional arguments require named arguments
E11061 takes priority over E11062 when both conditions apply. Already-named calls (detected via Phase 1 E06240 all-or-nothing) are skipped.

Both diagnostics carry the parameter names the CALLED method declares, in order (ErrorDetails.getDeclaredParameterNames()). This rule is the only place that holds the resolved method at the moment the error is raised, and the fix is nothing more than those names in that order - so it encodes them rather than leaving every consumer to re-resolve the call from its text. The MCP editors use them to LABEL the call rather than refuse it.