Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 364960 - [xtend] No assignments to 'this' in constructor and function
Summary: [xtend] No assignments to 'this' in constructor and function
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Target Milestone: M5   Edit
Assignee: Holger Schill CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-28 10:00 EST by Moritz Eysholdt CLA
Modified: 2017-09-19 17:03 EDT (History)
3 users (show)

See Also:
moritz.eysholdt: juno+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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