[GRADLE-2694] Wrong setter used by DSL Created: 26/Feb/13 Updated: 16/Jan/17 Resolved: 16/Jan/17 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | 1.3, 1.4 |
Fix Version/s: | None |
Type: | Bug | ||
Reporter: | Xavier Ducrohet | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Description |
My custom plugin extension has the following methods: Depending on the syntax used and the type of the parameter I get the following method called: foo "14" -> foo(String) As you can see in the #4 case, the wrong setter is called. |
Comments |
Comment by Benjamin Muschko [ 15/Nov/16 ] |
As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub. We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to. Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:
We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle! |
Comment by Benjamin Muschko [ 16/Jan/17 ] |
The following code calls the correct methods with Gradle 3.3. I am going to close the issue. def myExt = extensions.create('myExt', MyExtension) task callExtMethods { doLast { myExt.foo "14" myExt.foo 14 myExt.foo = "14" myExt.foo = 14 } } class MyExtension { def foo(int a) { println 'foo(int)' } def foo(String a) { println 'foo(String)' } def setFoo(int a) { println 'setFoo(int)' } def setFoo(String a) { println 'setFoo(String)' } } The output: $ gradle callExtMethods :callExtMethods foo(String) foo(int) setFoo(String) setFoo(int) BUILD SUCCESSFUL |