You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Aseem Bansal (JIRA)" <ji...@apache.org> on 2015/09/14 11:01:46 UTC

[jira] [Created] (GROOVY-7592) Problem in switch statement docs

Aseem Bansal created GROOVY-7592:
------------------------------------

             Summary: Problem in switch statement docs
                 Key: GROOVY-7592
                 URL: https://issues.apache.org/jira/browse/GROOVY-7592
             Project: Groovy
          Issue Type: Documentation
            Reporter: Aseem Bansal


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
{noformat}
String str = "aseem"

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



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)