Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 342108 - [Xtend] [Compiler] Remove private _this field
Summary: [Xtend] [Compiler] Remove private _this field
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: M7   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-07 03:51 EDT by Sven Efftinge CLA
Modified: 2017-09-19 17:21 EDT (History)
0 users

See Also:
sven.efftinge: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Efftinge CLA 2011-04-07 03:51:54 EDT
Currently the compiler generates a private field pointing to _this in order to point to that this also from within closures. We can instead generate "ClassName.this" when referencing 'this' and can remove the local variable.

Note, that this applies for 'super' as well.

To enhance the generated code we could check whether we are in a closure and only then use the qualified name to 'this'.
Comment 1 Sven Efftinge CLA 2011-04-07 04:28:22 EDT
pushed to master.

(In reply to comment #0)
> To enhance the generated code we could check whether we are in a closure and
> only then use the qualified name to 'this'.

Considered unimportant, since Bug 342116 will make use of 'this' (bound to XtendClass) very rare.
Comment 2 Sven Efftinge CLA 2011-04-07 10:55:18 EDT
Because the solution of Bug 342116 isn't improving the situation the compiler now uses the short 'this' and 'super' if possible.
Comment 3 Karsten Thoms CLA 2017-09-19 17:09:54 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 4 Karsten Thoms CLA 2017-09-19 17:21:42 EDT
Closing all bugs that were set to RESOLVED before Neon.0