Pattern matching for switch (Third Preview)

Tesla Zhang ice1000kotlin at foxmail.com
Wed Mar 23 18:49:16 UTC 2022


Hi,


I have two confusions about the new JEP:


0. I noticed a `<>` operator, is that a typo?
1. What's the motivation of replacing `??` with a new soft keyword? What's bad about `??`?


Best regards,
Tesla


------------------ Original ------------------
From:                                                                                                                        "Jan Lahoda"                                                                                    <jan.lahoda at oracle.com>;
Date: Thu, Mar 24, 2022 00:20 AM
To: "amber-dev"<amber-dev at openjdk.java.net>;

Subject: Pattern matching for switch (Third Preview)



Hi,

There is a new draft JEP for preview 3 of Pattern Matching for switch here:
https://bugs.openjdk.java.net/browse/JDK-8282272

The current ideas for improvements over the previous round are to remove 
guarded patterns and replace them with a "when" clause for the cases, 
and adjusting null handling more to the null handling in existing switches.

Feedback is welcome!

Thanks!
     Jan


More information about the amber-dev mailing list