Community
Participate
Working Groups
Build Identifier: 20100617-1415 Trying to get the ordinal for an enum using EnumType.allInstances()->asSequence()->indexOf(...) does not compute in the OCL Interpreter Console (empty result). It does for other types. See http://www.eclipse.org/forums/index.php?t=msg&th=173931&start=0&S=79151d79cb376a55a724e7980d46d1c7 for details. Reproducible: Always Steps to Reproduce: 1. Define enum EnumType with at least Literal as element 2. Compute EnumType.allInstances()->asSequence()->indexOf(EnumType::Literal)
CollectionKind.allInstances()->asSequence()->indexOf(CollectionKind::Set) works in the pivot evaluator. I looked at changing the modelled: type Enumeration conformsTo OclAny { static operation allInstances<OclSelf>() : Set<OclSelf>; } to OrderedSet, but now I realise that this is a total specification fudge corresponding to the implementation fudge that was required to make it 'work'. An enumeration literal is an EnumerationLiteral not an Enumeration (cf a property is a Property not a Class). CollectionKind.ownedLiteral->indexOf(CollectionKind::Set) also works and is semantically sensible. I think that Enumeration::allInstances() should be retracted. WONTFIX: Bugzilla only remains open to raise an OMG Issue.
OMG Issue 15420 raised.
CLOSED after a year in the RESOLVED state.