Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 355843

Summary: [xbase] Closure parameters clashing with outer context
Product: [Modeling] TMF Reporter: Daniel Simoes <ddsimoes>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: minor    
Priority: P3 CC: sebastian.zarnekow
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Daniel Simoes CLA 2011-08-25 10:16:52 EDT
Build Identifier: I20110613-1736

Trying this in PureXBase:

val a = 5
val (int, int)=>int sum = [a, b | a + b]

results in the following error: "Duplicate variable name 'a'".

Is it a feature? Isn't the parameter supposed to shadow the outer 'val'?

Thanks.


Reproducible: Always

Steps to Reproduce:
PureXBase:

val a = 5
val (int, int)=>int sum = [a, b | a + b]
Comment 1 Sebastian Zarnekow CLA 2011-09-29 10:45:45 EDT
Xbase does not support variable shadowing for now. It is explicitly validated that you use unique variable names.
Comment 2 Sebastian Zarnekow CLA 2011-10-17 16:42:23 EDT
See last comment. We don't have concrete plans to change the semantics.