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

Support multiple labels on the same statement

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

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6-rc-1
    • 2.4.0-beta-3
    • Compiler, parser-antlr2
    • None

    Description

      Unlike Java, Groovy doesn't support multiple labels on the same statement - instead, the AST builder discards all but the first (!) label:

      class MultipleLabels {
      static void main(args) {
      label1:
      label2:
      while (true)

      { break label1 // OK break label2 // Compile error: "break to missing label" }


      }
      }

      For a discussion see: http://www.nabble.com/Multiple-labels-on-the-same-statement-td21543898.html

      Attachments

        Activity

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

          People

            paulk Paul King
            pniederw Peter Niederwieser
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment