Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7710

Random resolution of an overloaded method with arrays as last parameter called without an argument

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.5
    • Fix Version/s: 2.4.6
    • Component/s: Static Type Checker
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              pascalschumacher Pascal Schumacher
              Reporter:
              fpavageau Frank Pavageau
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: