invocation-expression-instantiated-type

Available in: KerML, SysML

This checks that invocation expression invoke other behaviors, or features typed by a single behavior.

Behaviors are the only callable element type in KerML and SysML. Otherwise, elements have implicit constructors that must be called using constructor expressions using the keyword new.

Specification

The instantiated_type of an InvocationExpression must be either a Behavior or a Feature with a single type, which is a Behavior.

Example

attribute def A;
attribute a = A(); // error

Use constructor expression instead:

attribute def A;
attribute a = new A(); // ok