Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 339784

Summary: [language] Introduce a FlattenedCollection type behavior
Product: [Modeling] OCL Reporter: Ed Willink <ed>
Component: CoreAssignee: OCL Inbox <mdt-ocl-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:

Description Ed Willink CLA 2011-03-12 06:15:00 EST
The Collection(T).collect() iteration is currently unmodelable because many different input types yield the same output type.

Suggest intoduce a FlattenedCollection mix-in analoguous to the OrderedCollection mix-in. This would allow the declaration:

Collection(T).collect() : FlattenedCollection(T)

Application to Set(Sequence(Integer)) invokes the specialization

Bag(Set(Sequence(Integer))).collect() : FlattenedBag(Set(Sequence(Integer))) 

for which built-in type conformance determines that 

FlattenedBag(Set(Sequence(Integer))) conforms to FlattenedBag(Integer) which conforms to Bag(Integer).

The modeling problem on the iteration is therefore moved sideways to a built-in conformance on a special type; a special-behavior type rather than an irregular iteration.