@@ -180,6 +180,8 @@ class KerMLValidator extends AbstractKerMLValidator {
180180
181181 public static val INVALID_REDEFINITION_DIRECTION_CONFORMANCE = " validateRedefinitionDirectionConformance"
182182 public static val INVALID_REDEFINITION_DIRECTION_CONFORMANCE_MSG = " Redefining feature must have a compatible direction"
183+ public static val INVALID_REDEFINITION_END_CONFORMANCE = " validateRedefinitionEndConformance"
184+ public static val INVALID_REDEFINITION_END_CONFORMANCE_MSG = " Redefining feature must be an end feature"
183185 public static val INVALID_REDEFINITION_FEATURING_TYPES = ' validateRedefinitionFeaturingTypes'
184186 public static val INVALID_REDEFINITION_FEATURING_TYPES_MSG_1 = " A package-level feature cannot be redefined"
185187 public static val INVALID_REDEFINITION_FEATURING_TYPES_MSG_2 = " Owner of redefining feature cannot be the same as owner of redefined feature"
@@ -363,6 +365,7 @@ class KerMLValidator extends AbstractKerMLValidator {
363365 checkDistinguishibility(mem, aliasMemberships, INVALID_NAMESPACE_DISTINGUISHABILITY_MSG_1 )
364366 }
365367 if (namesp instanceof Type ) {
368+ ElementUtil . clearCachesOf(namesp)
366369 val inheritedMemberships = namesp. inheritedMembership
367370 for (mem: ownedMemberships) {
368371 checkDistinguishibility(mem, inheritedMemberships, INVALID_NAMESPACE_DISTINGUISHABILITY_MSG_2 )
@@ -601,6 +604,13 @@ class KerMLValidator extends AbstractKerMLValidator {
601604 SysMLPackage . eINSTANCE. redefinition_RedefinedFeature, INVALID_REDEFINITION_FEATURING_TYPES )
602605 }
603606 }
607+
608+ // validatRedefinitionEndConformance
609+
610+ if (redefinedFeature. isEnd && ! redefiningFeature. isEnd) {
611+ error(INVALID_REDEFINITION_END_CONFORMANCE_MSG , redef,
612+ SysMLPackage . eINSTANCE. redefinition_RedefinedFeature, INVALID_REDEFINITION_END_CONFORMANCE )
613+ }
604614 }
605615 }
606616
0 commit comments