function-return-parameter-membership

Available in: KerML, SysML

This checks that functions have at most one return parameter.

Note: this matches the Pilot implementation for validateFunctionResultParameterMembership constraint and only checks owned memberships.

Specification

A Function must have exactly one feature_membership (owned or inherited) that is a ResultParameterMembership.

(Yes, looks like a typo in the specification.)

Example

calc def C {
    return attribute = 4;
    return attribute = 4; // error
}

Remove the additional return parameters:

calc def C {
    return attribute = 4; // ok
}