Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 342107 - [Xtend] Add error check for variable name shadowing
Summary: [Xtend] Add error check for variable name shadowing
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: M7   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-07 03:21 EDT by Sven Efftinge CLA
Modified: 2017-09-19 17:51 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:21:55 EDT
Xtend supports shadowing of variable names.
This is useful and convenient in some situations. Mostly i the case, where you want to rebind 'this' in order to access properties of that variable in a convenient way.

toJava(Entity this) '''
   <<packageName>>

   public class <<name>> {
   }

'''

However the following is also possible but is usually unwanted:

foo(String foo) {
   val foo = 'other'
}
Comment 1 Sven Efftinge CLA 2011-04-19 08:02:53 EDT
We've decided to not support the shadowing of 'this', which turned out to be the only sensible use-case for variable shadowing. So we should disallow variable name shadowing alltogether.
Comment 2 Sven Efftinge CLA 2011-04-20 05:51:04 EDT
pushed to master
Comment 3 Karsten Thoms CLA 2017-09-19 17:40:41 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 4 Karsten Thoms CLA 2017-09-19 17:51:49 EDT
Closing all bugs that were set to RESOLVED before Neon.0