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

[1,2,] or ["a":1,] should be supported

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0-beta-10
    • 1.0-JSR-1
    • parser
    • None
    • all

    Description

      //test.groovy
      1 = [1,2,]
      l.each

      {println it}

      // end of test.groovy

      When I run it, an exception is thrown "Could not use ']' at 1:10". If l = [1,2], it will ok.

      But I think, groovy should support [1,2,] for in Java, array

      {"a", "b", }

      is supported. So, I think groovy should support the similar syntax

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            jez Jeremy Rayner
            wangbin wangbin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment