Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 344454 - [Xbase] nesting closures leads to 'Cannot refer to a non-final variable' compiler error in generated Java code
Summary: [Xbase] nesting closures leads to 'Cannot refer to a non-final variable' comp...
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   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-05-02 09:35 EDT by Jendrik Johannes CLA
Modified: 2017-09-19 18:17 EDT (History)
1 user (show)

See Also:
sven.efftinge: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jendrik Johannes CLA 2011-05-02 09:35:24 EDT
Build Identifier: 2.0.0.v201105010942	

Example:

newArrayList('1').filter(e|newArrayList('1').filter(f | f == e) == null)

leads to the following compiler error:

"Cannot refer to a non-final variable e inside an inner class defined in a different method"

The parameters of the generated apply() methods probably need to be final.


Reproducible: Always
Comment 1 Sven Efftinge CLA 2011-05-02 09:56:25 EDT
pushed to master
Comment 2 Karsten Thoms CLA 2017-09-19 18:08:33 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 18:17:58 EDT
Closing all bugs that were set to RESOLVED before Neon.0