| Summary: | [Xtend] Shodowing "this" in dispatch produces incorrect code | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Robert von Massow <rvonmassow> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | sebastian.zarnekow, sven.efftinge |
| Version: | 2.0.0 | Flags: | sven.efftinge:
indigo+
|
| Target Milestone: | M7 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Bug Depends on: | 341753 | ||
| Bug Blocks: | |||
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 |
Build Identifier: Having the two dispatch functions dispatch genPlainText(TextPart this){ } dispatch genPlainText(TextOrMarkup this) } the following Java code is produced: public Object _genPlainText(final TextOrMarkup _this) { return null; } public Object _genPlainText(final TextPart _this) { return null; } public Object genPlainText(final EObject _this) { if ((this instanceof TextOrMarkup)) { return _genPlainText((TextOrMarkup)this); } else if ((this instanceof TextPart)) { return _genPlainText((TextPart)this); } else { throw new IllegalArgumentException(); } } The argument to genPlainText is never used in the method itself, instead this is used. Calling the dispatch function will always result in an illegal argument exception. Reproducible: Always