Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 356763 - [Xbase] add another implicit variable name
Summary: [Xbase] add another implicit variable name
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 enhancement (vote)
Target Milestone: SR2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-06 03:32 EDT by Sven Efftinge CLA
Modified: 2017-09-19 18:13 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-09-06 03:32:12 EDT
It's often interesting to bind a variable to an implicit available name like 'this'.
However it's problematic to shadow 'this', since then all the local functions and elements are no longer visible. In Xtend for instance none of the extension methods would work any longer, since they are all invoked on 'this'.
Therefore we want to introduce a second implicit variable name 'it' which is the only variable name allowed to be shadowed anywhere,

With that you are able to write the following Xtend code:

def initialize(Person it) {
   name = "Horst"
   age = 64
}
Comment 1 Sven Efftinge CLA 2011-09-06 03:40:53 EDT
pushed to master
Comment 2 Karsten Thoms CLA 2017-09-19 18:03:05 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 18:13:17 EDT
Closing all bugs that were set to RESOLVED before Neon.0