Call for feedback -- enhanced switch

Jan Lahoda jan.lahoda at oracle.com
Mon Mar 25 15:41:52 UTC 2019


On 24.3.2019 19:00, forax at univ-mlv.fr wrote:
> hum, this one still doesn't work !
>
> enum MyEnum {
>      X, Y;
>
>      public static void main(String[] args) {
>           MyEnum myEnum = MyEnum.X;
>           int o;
>           var f = switch(myEnum) {
>               case X -> o = 5;
>               case Y -> o = 10;
>               // automatic exception
>           };
>           System.out.println(o);
>       }
> }

Thanks, I've filled:
https://bugs.openjdk.java.net/browse/JDK-8221413

Jan


More information about the amber-dev mailing list