Switch with the arrow syntax + throw not supported

Remi Forax forax at univ-mlv.fr
Wed Jan 29 13:48:26 UTC 2020


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