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

code compiled with CompileStatic will under some circumstances call wrong version of overloaded method

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.5
    • Fix Version/s: 2.1.6
    • Component/s: Static compilation
    • Labels:
      None

      Description

      I'm calling a Java API that has a method addImage(String...) and another addImage() which calls the first with a single argument.

      When I call the no-argument method from a Groovy class it works fine but if I add @CompileStatic to that Groovy class it will now dispatch to the varargs form with no arguments.

      Also I found that if the call target is a field of the Groovy class it works properly, this only happens when the call target is a local variable.

      I have been unable to reproduce this when calling a class of my own so I've attached a test case calling the same API I'm using (im4java).

        Attachments

          Activity

            People

            • Assignee:
              melix C├ędric Champeau
              Reporter:
              robfletcher Rob Fletcher
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: