| Summary: | [editor] Incorrect implicit self in iterator | ||
|---|---|---|---|
| Product: | [Modeling] OCL | Reporter: | Ed Willink <ed> |
| Component: | Core | Assignee: | OCL Inbox <mdt-ocl-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | Keywords: | plan |
| Version: | 3.0.0 | ||
| Target Milestone: | M7 | ||
| Hardware: | PC | ||
| OS: | Windows Vista | ||
| Whiteboard: | |||
Problem seems to involve references to the 'wrong' CS copy. In principle implicit self is handled, but Xtext reparses create multiple CS trees, so the wrong one is easy to use. Problem will go away once references terminate in the Pivot AST. The following fails interactively but not as a JUnit test. package bug328485 : bug = 'http://www.eclipse.org/mdt/ocl/bug328485' { class Bug328485 { property names : Named[*]; invariant Self: names->any(name = '') = 1; } class Named { property name : String; } } Indeed problem has gone away. Test added. CLOSED after a year in the RESOLVED state. |
operation child(childName : String[?]) : Person[?] { body: children->any(c : Person | c.name=childName); } works but operation child(childName : String[?]) : Person[?] { body: children->any(name=childName); } doesn't since implicit self is not resolved to the implicit iterator.