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 2026/04/18 13:51:00 UTC

[jira] [Updated] (GROOVY-11617) switch without break or other statement for the last case

     [ https://issues.apache.org/jira/browse/GROOVY-11617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Milles updated GROOVY-11617:
---------------------------------
    Affects Version/s: 3.x
                       4.x
                       5.x

> switch without break or other statement for the last case
> ---------------------------------------------------------
>
>                 Key: GROOVY-11617
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11617
>             Project: Groovy
>          Issue Type: Bug
>          Components: parser-antlr4
>    Affects Versions: 3.x, 4.x, 5.x
>            Reporter: Eric Milles
>            Priority: Major
>
> A switch statement without a break or other statement for the last case fails to parse:
> {code:groovy}
> switch (xxx) {
>   case yyy:
> }
> {code}
> The same happens for "default:" instead of "case yyy:". (It also happens for switch expressions without the expression "case zzz ->" but that is probably acceptable.)
> Adding ";" or "break" or any other statement after the case parses fine.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)