constructor-expression-no-duplicate-feature-redefinition

Available in: KerML, SysML

This checks that constructor arguments are bound only once.

In textual syntax, this is only possible by using named arguments as otherwise arguments are bound implicitly in the order features are declared or inherited.

Specification

Two different owned_features of the result of a ConstructorExpression must not redefine the same feature of the instantiated_type of the ConstructorExpression.

Example

part def F { a; b; }
x = new F(a=0, a=1); // error

Bind arguments only once:

part def F { a; b; }
x = new F(a=0, b=1); // ok