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

Bug 364960

Summary: [xtend] No assignments to 'this' in constructor and function
Product: [Modeling] TMF Reporter: Moritz Eysholdt <moritz.eysholdt>
Component: XtextAssignee: Holger Schill <Holger.Schill>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Holger.Schill, sebastian.zarnekow, sven.efftinge
Version: unspecifiedFlags: moritz.eysholdt: juno+
Target Milestone: M5   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:

Description Moritz Eysholdt CLA 2011-11-28 10:00:12 EST
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.
Comment 1 Sebastian Zarnekow CLA 2011-11-28 10:02:07 EST
Does this happen for methods, too?
Comment 2 Moritz Eysholdt CLA 2011-11-28 10:23:26 EST
yes,

---
class bar {
	def foo() {
		this = new bar()
	}
}
---

does not lead to validation errors.
Comment 3 Holger Schill CLA 2012-01-03 04:43:10 EST
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
Comment 4 Holger Schill CLA 2012-01-03 05:57:20 EST
pused check and tests to master
Comment 5 Karsten Thoms CLA 2017-09-19 16:51:57 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 6 Karsten Thoms CLA 2017-09-19 17:03:14 EDT
Closing all bugs that were set to RESOLVED before Neon.0