Community
Participate
Working Groups
Build Identifier: S201103231016 I generate code from a GenModel model. I use the following code : myEnum.getGenEnumLiterals()->filter(GenEnumLiteral) The problem seems to be due to the type EList, which is not handled properly by the filter operation. Reproducible: Always
This is due to us expecting "OCL" typing and infering the return type of some operation from those. In particular, this snippet -----8<----- if (xxx instanceof ArrayList) { result = OCL.createSequence(); } else if (xxx instanceof LinkedHashSet) { result = OCL.createOrderedSet(); } else if (xxx instanceof Set) { result = OCL.createSet(); } else { result = OCL.createBag(); } ----->8----- must be replaced everywhere by a code that reduce the number of "unordered" collections we can create (users usually want ordered collections, even when they think they want unordered ones :p) : -----8<----- if (xxx instanceof Bag) { result = OCL.createBag(); } else if (xxx instanceof HashSet && !(xxx instanceof LinkedHashSet)) { result = OCL.createSet(); } else if (xxx instanceof Set) { result = OCL.createOrderedSet(); } else { result = OCL.createSequence(); } ----->8-----
The fix has been contributed on HEAD. It will be available in Acceleo 3.1.0 M7.