Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: None
-
Fix Version/s: 1.6-rc-1, 1.5.8, 1.7-beta-1
-
Component/s: None
-
Labels:None
-
Testcase included:yes
-
Number of attachments :
Description
testSimilarNamesForMethodAndLocalWithLocalAsMethodArgument fails.
class DelegationTest extends GroovyTestCase { void testSimilarNamesForMethodAndLocalWithLocalAsMethodArgument() { new Executer().failingExecute() } void testSimilarNamesForMethodAndLocalWithNoArgMethod() { new Executer().workingExecute() } } class Executer { void convention(String arg) { println 'called' } void convention() { println 'called' } void failingExecute() { def convention= 'value' 10.times { this.convention(convention) } } void workingExecute() { def convention= 'value' 10.times { this.convention() } } }
Issue Links
- is related to
-
GROOVY-3156
Within a nested closure, "this.method()" works incorrectly if parent closure and outermost class have closures/methods of the same name
-
Activity
blackdrag blackdrag
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Link |
This issue depends upon |
blackdrag blackdrag
made changes -
| Link |
This issue depends upon |
Roshan Dawrani
made changes -
| Link |
This issue is related to |
Roshan Dawrani
made changes -
| Assignee | Roshan Dawrani [ roshandawrani ] |
Roshan Dawrani
made changes -
| Fix Version/s | 1.7-beta-1 [ 14014 ] | |
| Fix Version/s | 1.6-rc-1 [ 14009 ] | |
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Resolution | Duplicate [ 3 ] | |
| Fix Version/s | 1.5.8 [ 14630 ] |
Paul King
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |
This bug is internally related to same implementation issue in ACG as identified in
GROOVY-3156. Even this is case of a method call expression explicitly qualified by "this" being made inside a closure when compileStack contains a variable of the same name as the method.The patches supplied with
GROOVY-3156fix this issue as well on versions 1.5.8, 1.6-RC-1, 1.7-beta-1. I have test verified.rgds,
Roshan