viatra / EMF-IncQuery

This repository is only kept for historic reasons. All development happens on eclipse.org
http://eclipse.org/viatra
13 stars 4 forks source link

Type checking for transitive closures #341

Closed ujhelyiz closed 11 years ago

ujhelyiz commented 11 years ago

As users found out, the type checker does not check whether the parameters of the called pattern have the same (or comparable) types.

E.g. because of the type incompatibility the match set of the eAllContainments pattern is always equivalent to the transitive closure, so the transitive closure operator is entirely ineffective.

pattern test() {
   find eAllContainments+(PH_OrigCont,extracts); //There should be a type warning (or possibly error)
}

pattern eAllContainments(This : EClass, Target : EReference){
   find eAllReferences(This, Target);
   EReference.containment(Target, true);
}
ujhelyiz commented 11 years ago

For such issues an error is reported now. Marking as resolved.

istvanrath commented 11 years ago

Fixed.