You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (JIRA)" <ji...@apache.org> on 2018/01/11 17:25:00 UTC

[jira] [Created] (GROOVY-8444) Support unqualified enum constants in switch cases (like Java)

Eric Milles created GROOVY-8444:
-----------------------------------

             Summary: Support unqualified enum constants in switch cases (like Java)
                 Key: GROOVY-8444
                 URL: https://issues.apache.org/jira/browse/GROOVY-8444
             Project: Groovy
          Issue Type: Improvement
            Reporter: Eric Milles
            Priority: Minor


Would it be possible to support this syntax that Java requires for enum constants in switch statements?

{code}
enum SomeEnum { A, B }
void meth(SomeEnum e) {
  switch (e) {
  case A: // currently this must be qualified, like SomeEnum.A
    ...
    break
  case B:
    ...
    break
  }
}
meth(SomeEnum.A) // currently throws MissingPropertyException: No such property: A for class...
{code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)