Community
Participate
Working Groups
Using Ecore.ecore, select EObject Evaluating: eOperations.eType.oclAsSet().name Results: 'EClass' 'EBoolean' 'EResource' 'EObject' 'EStructuralFeature' 'EReference' 'EEList' 'ETreeIterator' 'EEList' 'EJavaObject' 'EJavaObject' 'EBoolean' 'EJavaObject' But Evaluating: eOperations->collect(eType)->collect(oclAsSet())->collect(name) Results: 'EObject' 'EObject' 'EObject' 'EObject' 'EObject' 'EObject' 'EObject' 'EObject' 'EObject' 'EObject' 'EObject' 'EObject' 'EObject' Why the difference?
eOperations->collect(eType)->collect(c : EClassifier | c.oclAsSet())->collect(name) works and eOperations->collect(eType)->collect(self.oclAsSet())->collect(name) reproduces the problem. Looks like an implicit source problem.
The problem is that the implicit collect did not flatten the Bag<Set<>> and so the subsequent name property had to search out to self to find a name. EssentialOCLLeft2RightVisitor.resolveOperationReturnType now flattens the return type declaration for collect. Additionally some bit rot had set in and in M3, an implicit collect as a source was not flattened either. NavigationOperatorCSScopeAdapter.computeLookup fixed. Tests added. Pushed to master.
CLOSED after a year in the RESOLVED state.