Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.6-beta-1
-
Fix Version/s: 1.6-rc-1, 1.5.8, 1.7-beta-1
-
Component/s: parser
-
Labels:None
-
Testcase included:yes
-
Number of attachments :
Description
I guess this may be a parser bug (I'm not sure).
This class is working fine:
private class TestClosure {
def test = 1
def c1 = {
def test = 2
def c2 =
c2()
}
}
new TestClosure().c1()
But when we change:
def c2 =
{ println this.test this.test+=10 println this.test test = 3 }then thing is screwed up.
'this.test' is resolved to be 'test' of the c1 closure, which is not correct.
Issue Links
- is depended upon by
-
GROOVY-3156
Within a nested closure, "this.method()" works incorrectly if parent closure and outermost class have closures/methods of the same name
-