Details

    • Type: Sub-task Sub-task
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.1-rc-3
    • Fix Version/s: 4.0
    • Component/s: parser-antlr
    • Labels:
      None

      Description

      Declaring and populating an array in line such as:

      Object[] objArr = new Object[]

      { "a", "b", "d" }

      ;

      causes the following exception:

      Exception in thread "main" org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, ModelNumberParser.groovy: 7: unexpected token: , @ line 7, column 45

      It would be better, especially for Java people just learning Groovy, to say something like "Java initialization syntax not supported, use [x, y, z] as DesiredClass[]."

      EDIT: probably filed against a JSR version.

        Issue Links

          Activity

          Martin C. Martin created issue -
          Guillaume Delcroix made changes -
          Field Original Value New Value
          Assignee Guillaume Laforge [ guillaume ]
          Andres Almiray made changes -
          Assignee Jochen Theodorou [ blackdrag ]
          Andres Almiray made changes -
          Description Declaring and populating an array in line such as:

          Object[] objArr = new Object[] { "a", "b", "d" };

          causes the following exception:

          Exception in thread "main" org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, ModelNumberParser.groovy: 7: unexpected token: , @ line 7, column 45

          It would be better, especially for Java people just learning Groovy, to say something like "Java initialization syntax not supported, use [x, y, z] as DesiredClass[]."
          Declaring and populating an array in line such as:

          Object[] objArr = new Object[] { "a", "b", "d" };

          causes the following exception:

          Exception in thread "main" org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, ModelNumberParser.groovy: 7: unexpected token: , @ line 7, column 45

          It would be better, especially for Java people just learning Groovy, to say something like "Java initialization syntax not supported, use [x, y, z] as DesiredClass[]."

          EDIT: probably filed against a JSR version.
          Component/s ast builder [ 10444 ]
          Affects Version/s 1.1-rc-3 [ 13166 ]
          Fix Version/s 1.2 [ 13832 ]
          Jochen Theodorou made changes -
          Issue Type Bug [ 1 ] Sub-task [ 7 ]
          Parent GROOVY-3099 [ 75171 ]
          Jochen Theodorou made changes -
          Component/s ast builder [ 10444 ]
          Fix Version/s 1.6 [ 13832 ]
          Component/s parser-antlr [ 11322 ]
          Paul King made changes -
          Link This issue is related to GROOVY-3791 [ GROOVY-3791 ]
          Jochen Theodorou made changes -
          Issue Type Sub-task [ 7 ] Bug [ 1 ]
          Parent GROOVY-3099 [ 75171 ]
          Jochen Theodorou made changes -
          Issue Type Bug [ 1 ] Sub-task [ 7 ]
          Parent GROOVY-4705 [ 122648 ]
          Jochen Theodorou made changes -
          Assignee blackdrag blackdrag [ blackdrag ]
          Fix Version/s 4.0 [ 18928 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
          Mark Thomas made changes -
          Workflow jira [ 12730718 ] Default workflow, editable Closed status [ 12742623 ]
          Mark Thomas made changes -
          Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
          Mark Thomas made changes -
          Workflow jira [ 12969006 ] Default workflow, editable Closed status [ 12976783 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Martin C. Martin
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Development