redefinition-featuring-types
Available in: KerML, SysML
This checks that redefining feature featuring types different to the featuring types of the redefined feature.
Specification
The
redefining_featureof aRedefinitionmust have at least onefeaturing_typethat is not also afeaturing_typeof theredefined_feature.
Example
This can be triggered by a package-level feature redefining another package-level feature:
attribute a;
attribute b :>> a; // error
Instead, redefine package-level features from a type:
attribute a;
part def P { attribute b :>> a; } // ok
Additionally, this can be triggered in KerML by overriding default featuring types:
class A { feature a; }
feature b :>> A::a featured by A; // error
Instead, prefer overriding only package-level, or directly inherited features:
class A { feature a; }
class B :> A { feature b :>> A::a; } // ok