You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Variable type cannot be calculated unambiguously, the types
[hu.qgears.viatra.bug.base1::OtherClass, hu.qgears.viatra.bug.base1::Base1]
have no unique common supertype. The list of possible supertypes
found are [EObject], specify one as the intended supertype.
I'm not sure this is a bug, but the mentioned syntax worked with earlier versions (1.6.0). And also works, if I do not call other patterns (with 'find' keyword) from pattern body.
Sorry for the late response, I did not have time to respond before.
In general, we strongly recommend always defining the types of pattern parameters, as that helps both with the parsing times and providing better feedback - so I suggest going with the workaround as a stable solution.
Regardless, the issue you have seen is truly misleading and should be fixed in our end. It is most likely related to the fact that the inferred parameter is EObject that we have already received reports we are not handling correctly, e.g. bug 506471 and bug 541567 also point at similar issues.
| --- | --- |
| Bugzilla Link | 561652 |
| Status | UNCONFIRMED |
| Importance | P3 normal |
| Reported | Apr 01, 2020 10:54 EDT |
| Modified | Apr 03, 2020 11:56 EDT |
| Version | 2.3.1 |
| Reporter | István Ágoston |
Description
I got an error (not warning, which would be ok) message on the following query:
pattern bug1_(test ){
find matchingBase1(test);
} or {
find matchingOther(test);
}
private pattern matchingOther(o : OtherClass){
OtherClass.ref(o,"test");
}
private pattern matchingBase1(b : Base1){
Base1.b1Prop(b,1);
}
The error says: Multiple errors on 'test'\
is used instead.
[hu.qgears.viatra.bug.base1::OtherClass, hu.qgears.viatra.bug.base1::Base1]
have no unique common supertype. The list of possible supertypes
found are [EObject], specify one as the intended supertype.
Workaround:
pattern bug1Workaround(test : EObject){
find matchingBase1(test);
} or {
find matchingOther(test);
}
I'm not sure this is a bug, but the mentioned syntax worked with earlier versions (1.6.0). And also works, if I do not call other patterns (with 'find' keyword) from pattern body.
The full example project is available on github : https://github.com/agostoni/bugreports/tree/master/viatra/hu.qgears.viatra.bug.patterns
The text was updated successfully, but these errors were encountered: