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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.5
    • 2.4.6
    • Static Type Checker
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: