Community
Participate
Working Groups
Steps to reproduce : - with basicfamily, add a Selection Wizard tool - in precondition, add "aql:container.oclIsTypeOf(basicfamily::Family)" Completion and runtime works. But validation creates a "Always false" error : " Description Resource Path Location Type Always false: Nothing inferred when self (EClassifier=EObject) is type of EClassifierLiteral=Talk conference.odesign /fr.obeo.conference.design/description Unknown EMF Problem "
I confirm the bug, I have had the same through Bug 484217
Etienne can you tell us if you did reference the "basicfamily" metamodel in your DiagramDescription or not ?
(In reply to Etienne Juliot from comment #0) > Steps to reproduce : > - with basicfamily, add a Selection Wizard tool > - in precondition, add "aql:container.oclIsTypeOf(basicfamily::Family)" > > Completion and runtime works. But validation creates a "Always false" error > : " > > Description Resource Path Location Type > Always false: > Nothing inferred when self (EClassifier=EObject) is type of > EClassifierLiteral=Talk conference.odesign > /fr.obeo.conference.design/description Unknown EMF Problem > " The report is misleading as its mixing the basicfamily & conference examples but it can be reproduced with basicfamily (I'm attaching the model). With the recent changes in AQL and Sirius it is now a warning (and not an "error".) if oclIsKindOf(basicfamily::Family) is used instead of oclIsTypeOf() then everything is fine. Looks like AQL's type inference is failing in the case of oclIsTypeOf()
Created attachment 259452 [details] basicfamily.odesign with a selectionwizard having a false positive warning
It's not quiet clear to me which level you are using to report type inference status. But I will suggest that you keep INFO level as in AQL...
(In reply to Yvan Lussaud from comment #5) > It's not quiet clear to me which level you are using to report type > inference status. But I will suggest that you keep INFO level as in AQL... INFO is ok on the AQL side, Sirius only knows about warning and errors so an "INFO" will be changed into a WARNING (see IInterpreterStatus and AQLSiriusInterpreter.analyzeExpression(IInterpreterContext, String) ) which is... ok I guess. But it used to be transformed as ERRORS (See Bug 485610)
Whatever the level you choose, the message should be more explicit. "Always false" doesn't really help. It would better if you can provide a message like "Ambiguous expression. Use oclIsKindOf() instead of oclIsTypeOf()." But at the end, the real fix should support oclIsTypeOf with the good inference behavior, and no warning at all.
(In reply to Etienne Juliot from comment #7) > Whatever the level you choose, the message should be more explicit. "Always > false" doesn't really help. > It would better if you can provide a message like "Ambiguous expression. Use > oclIsKindOf() instead of oclIsTypeOf()." I don't get it. There is no ambiguity, the warning is "Hey, your expression will *always* be false, are you sure that's what you meant ?" Let's say a variable called "element" can only be a UML::Class or a UML::Attribute and you write "element.oclIsTypeOf(uml::Parameter)" This expression will always be false. AQL can't say "use oclIsKindOf instead" as these are two very different things. oclIsKindOf is true of the instance is compatible with the given type, even for subclasses. oclIsTypeOf is only true if this is the exact type and not a subclass. > But at the end, the real fix should support oclIsTypeOf with the good > inference behavior, and no warning at all. Indeed, in this case AQL this is bug, the bug does not exists with oclIsKindOf as its has been way more used and tested already compared to oclIsTypeOf which have very litle use. Would "The expression XXXX will always be true (or false)" be an improvement in your opinion ?
This bug should be fixed with this review: https://git.eclipse.org/r/#/c/65487/