| Summary: | [pivot] collectNested fails on heterogeneous collections | ||
|---|---|---|---|
| Product: | [Modeling] OCL | Reporter: | Ed Willink <ed> |
| Component: | Core | Assignee: | 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: | |||
For Sequence{Sequence{'this and', 'that'}, 'the other'}->collectNested(s : String | s.toUpperCase()) the iteration fails on a non-String first term. NB. The current IteratorsTest tests have no nested collections on which to collectNested is exercised. The nested test on collect is wierd Sequence{Sequence{'this and', 'that'}, Sequence{'the other'}}->collect(s : Sequence(String) | s.toUpperCase()) using a collection iterator for the double depth and then flattenning. Equivalent code is Sequence{Sequence{'this and', 'that'}, Sequence{'the other'}}->collect(s : Sequence(String) | s->collect(toUpperCase())) Philosophical issue. How can a Collection of collections be collected if collect iterates over non-collection elements?