invocation-expression-parameter-redefinition
Available in: KerML, SysML
This checks that invocation arguments are bound to the instantiated type input features only, and only once, i.e. that there are no extraneous or unrelated arguments.
Specification
Each
inputparameter of anInvocationExpressionmust redefine exactly oneinputparameter of theinstantiated_typeof theInvocationExpression.
Example
calc def F { in a; out b; }
x = F(a=0, b=1); // error: Unexpected argument: invocation expression argument must redefine an input feature
Do not bind arguments to out features:
calc def F { in a; out b; }
x = F(a=0); // ok
Additionally, this is also diagnosed when there are too many arguments:
calc def G { in a; }
x = G(0, 1); // error: Unexpected argument: invocation expression argument must redefine an input feature
Remove extraneous arguments:
calc def G { in a; }
x = G(0); // ok