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

[PARROT] Support Java Array initializer syntax when not ambiguous

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.6.4
    • 3.0.0-alpha-1, 2.6.0-alpha-1
    • syntax
    • None

    Description

      Run the attached one line file and you get:

      ================================================================
      C:\Temp>groovyc arrayInitializer.groovy
      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed,
      arrayInitializer.groovy: 3: No expression for the array constructor call at line
      : 3 column: 29. File: arrayInitializer.groovy @ line 3, column 29.
      String[] junk = new String[]

      {"xxx"}

      ;
      ^

      1 error

      =================================================================

      Of course the line is perfectly correct. Try the attached java file which is an exact
      copy of the groovy file. It compiles fine.

      Attachments

        1. arrayInitializer.groovy
          0.1 kB
          Steve Buroff
        2. ArrayInitializer.java
          0.1 kB
          Steve Buroff

        Issue Links

          Activity

            People

              daniel_sun Daniel Sun
              hermit69 Steve Buroff
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: