eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[editor] Incorrect implicit self in iterator #611

Closed eclipse-ocl-bot closed 4 hours ago

eclipse-ocl-bot commented 4 hours ago

| --- | --- | | Bugzilla Link | 328485 | | Status | CLOSED FIXED | | Importance | P3 normal | | Reported | Oct 22, 2010 11:01 EDT | | Modified | May 20, 2013 11:38 EDT | | Version | 3.0.0 | | Reporter | Ed Willink |

Description

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.

eclipse-ocl-bot commented 4 hours ago

By Ed Willink on Oct 23, 2010 14:34

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.

eclipse-ocl-bot commented 4 hours ago

By Ed Willink on Oct 23, 2010 14:39

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;\ }\ }

eclipse-ocl-bot commented 4 hours ago

By Ed Willink on Apr 05, 2012 16:05

Indeed problem has gone away. Test added.

eclipse-ocl-bot commented 4 hours ago

By Ed Willink on May 20, 2013 11:38

CLOSED after a year in the RESOLVED state.