global-namespace-distinguishability

Available in: KerML, SysML

This checks that all top-level member names are globally unique.

Globally ambiguous names can lead to subtle and hard-to-debug issues because the specification does not specify which name should be selected. This is especially important for standard base types, such as Parts::Part, because a lot of semantic constraints and name resolution depend on those types being present in the hierarchy, implicitly or explicitly.

Example

// A1.sysml
package A; // warning

// A2.sysml
package A; // warning

Ensure top-level members have unique names, or use hidden visibility for all non-unique names:

// A1.sysml
private package A; // ok

// A2.sysml
private package A; // ok