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

Problem in switch statement docs

    XMLWordPrintableJSON

Details

    • Documentation
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.4.5
    • 2.4.6
    • Documentation
    • None

    Description

      As per http://www.groovy-lang.org/semantics.html default must be the last thing in switch case.

      Based on that I sent a PR which has been accepted
      https://github.com/apache/incubator-groovy/pull/82

      But when I tried to use default somewhere else it worked fine

      String str = "aseem"
      
      switch(str) {
          default:
              println "default"
              break
          case "aseem":
              println "Aseem"
              break
      } 
      

      Attachments

        Activity

          People

            pascalschumacher Pascal Schumacher
            anshbansal Aseem Bansal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: