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

Bug 358512

Summary: allSubobjects() should not operate on collections
Product: [Modeling] QVTo Reporter: Wilbert Alberts <wilbert.alberts>
Component: EngineAssignee: Project Inbox <mmt-qvt.operational-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: serg.boyko2011, wilbert.alberts
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Wilbert Alberts CLA 2011-09-22 02:26:25 EDT
Build Identifier: Build id: 20110615-0604

It turns out that it is possible to invoke allSubobjects on a set. E.g:
var m: OrderedSet(Element)
var sm := m->allSubobjects()

However, allSubobjects() operates on Element and a collection does conform to an Element.

Reproducible: Always

Steps to Reproduce:
1. Create a QVT transformation containing the code shown in the details.
2. Execute it and see that it runs.
3. It shouldn't ;-)
Comment 1 Sergey Boyko CLA 2013-12-25 10:54:32 EST
Expression 
  var sm := m->allSubobjects()
is the shorthand for the following
  var sm := m->xcollect(i | i.allSubobjects())

This is due to specification, Section 8.2.2.7 ImperativeIterateExp :
"
If a property is invoked with "->" symbol and no “bracket” follows, this means that xcollect construct is being used.
  list->prop; // same as list->xcollect(i | i.prop), the iterator variable is implicit here
"