redefinition-conformance

Available in: KerML, SysML

This checks that redefined and redefining features are not from the same type.

Redefining a feature has the effect of hiding the redefined feature from the scope, this has no valid meaning when both features are in the same scope.

Specification

Per KerML 8.2.3.5.1:

The basic name resolution process is used directly to resolve a qualified name in all cases except when the qualified name specifies the redefinedFeature of a Redefinition with an owningFeature that has an owningType. In this case, the basic name resolution processes is repeated with the general Type of each ownedSpecialization of the owningType considered in turn as the local Namespace, until a resolution is found. If no resolution is found for any of these, then the overall resolution fails.

Example

part def A { attribute a; }
part def B :> A {
    attribute b :>> self.c; // error: Features from the same type should not be redefined
    attribute c;
}

Do not redefine features from the same type:

part def A { attribute a; }
part def B :> A {
    attribute b :>> self.a; // ok
    attribute c;
}

All validation rules