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

Varargs in constructor are not treated correctly when creating instances of anonymous class

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.0.5
    • None

    Description

      Code snippet to reproduce the bug:

      class Test {
      
          public Test(String... args) {
              println args
          }
      
          public static void main(String[] args) {
              new Test('oneWord')
              new Test('manyLetters') {
                  @Override
                  int hashCode() {
                      return 1;
                  }
              }
          }
      }
      

      expected output:

      [oneWord]
      [manyLetters]
      

      actual:

      [oneWord]
      [m, a, n, y, L, e, t, t, e, r, s]
      

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              artyushov Nikita Artyushov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: