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

Can't find constractor with an array parameter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-beta-6
    • 1.0-beta-10
    • None
    • None
    • Windows XP

    Description

      This code:
      --------
      class Test {
      Test(s) {
      }
      }

      String[] s = new String[3]
      s[0] = "abc"
      s[1] = "abc"
      s[2] = "abc"
      assert s.class.toString() == "class [Ljava.lang.String;"

      c = new Test(s)

      --------
      causes following Exception:

      ========
      Caught: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: Test(java.lang.String, java.lang.String, java.lang.String)
      ========

      Results of instance method or static method are same above.
      But toplevel can be called in same parameter declaration.

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            uehara UEHARA Junji
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: