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

Anonymous class with elipsis type in constructor

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-beta-1
    • 2.4.0-rc-1
    • Compiler
    • None

    Description

      'main.groovy'
      abstract class Abc {
          Abc(String... s) {}
          
          abstract def run()
      }
      
      print new Abc() {
          def run(){}
      }
      

      Try to run this code sample and get the following exception :
      Caught: java.lang.ArrayIndexOutOfBoundsException: 0
      java.lang.ArrayIndexOutOfBoundsException: 0
      at main$1.<init>(main.groovy)
      at main.run(main.groovy:7)

      Attachments

        Activity

          People

            Unassigned Unassigned
            mxm-groovy Maxim Medvedev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: