[
https://issues.apache.org/jira/browse/GROOVY-7710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15059925#comment-15059925
]
ASF GitHub Bot commented on GROOVY-7710:
----------------------------------------
GitHub user fpavageau opened a pull request:
https://github.com/apache/groovy/pull/213
GROOVY-7710 GROOVY-7711 Apply the rules to resolve method consistently
A no-arg call to a varargs method needs to be resolved with the same rules
as when there are exactly the same number of parameters, or even more, by
applying the class distance and extension method biases.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/fpavageau/groovy GROOVY-7710-7711
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/groovy/pull/213.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #213
----
commit 77e983f654f757d1d517ede03db4b330b7d20ca5
Author: Frank Pavageau <[email protected]>
Date: 2015-12-02T14:23:42Z
Extract common behaviors from the method signature resolution
commit 5288b277cae286306b5d0fb0299cd1e8bfc46cdb
Author: Frank Pavageau <[email protected]>
Date: 2015-12-14T21:58:17Z
GROOVY-7710 GROOVY-7711 Apply the rules to resolve method consistently
A no-arg call to a varargs method needs to be resolved with the same rules
as when there are exactly the same number of parameters, or even more, by
applying the class distance and extension method biases.
----
> Random resolution of an overloaded method with arrays as last parameter
> called without an argument
> --------------------------------------------------------------------------------------------------
>
> Key: GROOVY-7710
> URL: https://issues.apache.org/jira/browse/GROOVY-7710
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Affects Versions: 2.4.5
> Reporter: Frank Pavageau
> Assignee: Cédric Champeau
>
> When calling a method with overloads that have arrays as their last parameter
> (such as {{Arrays.sort()}} or {{Arrays.hashCode()}} that have multiple
> overloads, e.g. with all primitive arrays) but no argument (valid since an
> array is equivalent to varargs in Groovy), the static type checker resolves
> to the first (random) method instead of failing because of the ambiguous call.
> I have a fix for the bug, but it's based on my pull request for GROOVY-7420
> as it's in the same method and I wanted to avoid a painful merge. I'd rather
> see that fix applied first before creating a new PR, but could extract the
> same kind of fix based on the current code if necessary, though.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)