Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.6-beta-1
-
None
-
java version "1.5.0_04" on Windows XP
Description
This issue is related to issue reported in GROOVY-2849, which is reported for same kind of interference for property access inside a nested closure. For easier management of fixes, testing, etc, it was suggsted that for issue with method calls, a separate JIRA bug be created.
Testcase for the issue:
class NestedClosureMethodCallBug extends GroovyTestCase { def void testNestedClosureMethodCall(){ assert m() == "method" assert c1() == "method" } def m = {return "method"} def c1 = { def m = {return "c1"} def c2 = { /* * If both 'm()' and 'this.m()' are used as follows, * 'this.m()' should not resolve to c1 closure's 'm' local variable. * It should resolve to outermost NestedClosureMethodCallBug's 'm()'. */ assert m() == "c1" return this.m() } c2() } }
Attachments
Attachments
Issue Links
- depends upon
-
GROOVY-2849 A property name in a nested closure interferes with a class property when refering with "this.prop"
- Closed
- relates to
-
GROOVY-2621 Local variable shadows method in closure call, even if method is called with this keyword.
- Closed