| Summary: | [xtend] No assignments to 'this' in constructor and function | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Moritz Eysholdt <moritz.eysholdt> |
| Component: | Xtext | Assignee: | Holger Schill <Holger.Schill> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | Holger.Schill, sebastian.zarnekow, sven.efftinge |
| Version: | unspecified | Flags: | moritz.eysholdt:
juno+
|
| Target Milestone: | M5 | ||
| Hardware: | Macintosh | ||
| OS: | Mac OS X | ||
| Whiteboard: | |||
Does this happen for methods, too? yes,
---
class bar {
def foo() {
this = new bar()
}
}
---
does not lead to validation errors.
Will introduce a validation for that. The message could be the same as in JDT: Left-hand side of an assignment must be an variable pused check and tests to master Closing all bugs that were set to RESOLVED before Neon.0 Closing all bugs that were set to RESOLVED before Neon.0 |
I'm not sure Xtend wants to fulfill the magic that this code snippet promises to deliver --- class foo extends bar { new(String i, String x) { this = new foo("", "x") } } --- currently, there are no validation errors. I'd expect an error that assignments to "this" are not allowed.