| Summary: | [xtend] member initializer with refs to member vars compile to invalid java code | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Moritz Eysholdt <moritz.eysholdt> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | sebastian.zarnekow |
| Version: | unspecified | Flags: | moritz.eysholdt:
juno+
|
| Target Milestone: | M4 | ||
| Hardware: | Macintosh | ||
| OS: | Mac OS X | ||
| Whiteboard: | |||
Pushed to master. Closing all bugs that were set to RESOLVED before Neon.0 Closing all bugs that were set to RESOLVED before Neon.0 |
The snippet --- class bar { int i = 12 int x = i + 1 } --- compiles to --- public class bar { private int i = 12; private int x = new Function0<Integer>() { public Integer apply() { int _operator_plus = IntegerExtensions.operator_plus(((Integer)this.i), ((Integer)1)); return _operator_plus; } }.apply(); } --- which doesn't compile due to the error "i cannot be resolved or is not a field" under "this.i". I'd expect "bar.this.i" to be generated by the compiler instead of "this.i".