namespace-distinguishability

Available in: KerML, SysML

This checks that namespace member names are unambiguous.

Note that this does not yet check imported memberships, and only checks that owned members are not ambiguous with inherited members, that is inherited names are not checked across specializations.

Specification

All memberships of a Namespace must be distinguishable from each other.

Example

Owned members:

package A;
package <A>; // error

Inherited members:

part def A { attribute a; }
part def B :> A { attribute  a; } // error

Aliases:

part def A { attribute a; }
part def B :> A { alias a for A; } // error

Multiple inheritance:

part def A { attribute a; }
part def B { attribute a; }
part def C :> A, B { attribute a :>> A::a; } // error

There is no general fix, although multiple inheritance case can be fixed by redefining all ambiguous inherited members:

part def A { attribute a; }
part def B { attribute a; }
part def C :> A, B { attribute a :>> A::a, B::a; } // ok