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

Expecting to find object/array on stack

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5.5, 1.6, 1.6.4, 1.6.5
    • 1.6.6, 1.7-rc-1
    • None
    • None

    Description

      Repro:
      Compile and run the following:

      class Test
      {
              String string
              URI[] uris
      
              public Test(String string, URI[] uris)
              {
                      this.string = string
                      this.uris = uris
              }
      
              public Test(String string, List uris)
              {
                      this(string, uris.collect { new URI(it) } as URI[])
              }
      
              public static void main(String[] args)
              {
                      def test = new Test('hello', ["world"])
                      println test.string
                      println test.strings
              }
      }

      Observed Result:

      $ groovyc Test.groovy
      $ groovy Test
      Caught: java.lang.VerifyError: (class: Test, method: <init> signature: (Ljava/lang/String;Ljava/util/List;)V) Expecting to find object/array on stack

      Expected Result:

      hello
      [world]
      

      Attachments

        1. Test.groovy
          0.4 kB
          sukhyun.cho

        Activity

          People

            roshandawrani Roshan Dawrani
            sukhyun.cho sukhyun.cho
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: