[
https://issues.apache.org/jira/browse/GROOVY-8444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16959872#comment-16959872
]
Eric Milles edited comment on GROOVY-8444 at 10/25/19 3:46 PM:
---------------------------------------------------------------
> As we need to check whether the switch-case is for enum, type info is
> required, so it only works when STC is enabled.
Is it possible to support this for dynamic Groovy as well? When converting a
Java source to Groovy, {{@CompileStatic}} is not applied automatically.
was (Author: emilles):
> As we need to check whether the switch-case is for enum, type info is
> required, so it only works when STC is enabled.
Is it possible to support this for dynamic Groovy as well? When converting a
Java source to Groovy, `@CompileStatic` is not applied automatically.
> 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
> Components: Static compilation
> Reporter: Eric Milles
> Assignee: Daniel Sun
> Priority: Major
> Fix For: 3.0.0-rc-1
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> Would it be possible to support this syntax that Java requires for enum
> constants in switch statements?
> {code:java}
> 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(someEnumValue) // currently throws MissingPropertyException: No such
> property: A for class...
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)