Switch with the arrow syntax + throw not supported
Robert Field
robert.field at oracle.com
Thu Jan 30 00:22:43 UTC 2020
The bug is:
https://bugs.openjdk.java.net/browse/JDK-8238173
There are some triage notes.
I'll look at this for JDK 15.
-Robert
On 2020-01-29 06:48, Michel Trudeau wrote:
> It even fails with the old syntax:
>
>
>
> And that’s a regression introduced in JDK 12, as it was working in 11. We’ll file a bug.
>
> -Michel
>
> On Jan 29, 2020, at 5:48 AM, Remi Forax <forax at univ-mlv.fr> wrote:
>
> Hi all,
> this snippet of code doesn't work with jshell.
>
> jshell> var foo = "foo";
> ...> switch(foo) {
> ...> default -> throw new AssertionError();
> ...> }
> foo ==> "foo"
> | Error:
> | unreachable statement
> | }
> | ^
>
> Obviously, it works with javac.
>
> regards,
> Rémi
>
More information about the kulla-dev
mailing list