New candidate JEP: 441: Pattern Matching for switch
David Alayachew
davidalayachew at gmail.com
Sat Mar 18 03:59:01 UTC 2023
Hello Amber Dev Team,
I am very excited for this feature. I think the new levels of
exhaustiveness that this feature enables will remove a common source of
bugs for me when I write code.
Looking at the link, I am very happy to see that switch expressions will
now play nicer with enums under a sealed type. This was a pain point for
code I was writing a few months ago [1], so having this will streamline my
development by a lot.
I also very much like to see that parenthesized patterns are being removed,
to be handled later. In general, I like the idea of simply deferring the
uncommon edge cases to be dealt with in the future. Curious to see how it
will be dealt with in the future.
That said, could we add a short description of what parenthesized patterns
are? Perhaps I missed a discussion on it, but I didn't even know that they
existed until I saw this JEP back when it was a JEP Draft. And if not a
description, maybe a link to some official Oracle documentation? This link
[2] is how I figured out what parenthesized patterns are.
Thank you all for your time and effort!
David Alayachew
[1] = https://mail.openjdk.org/pipermail/amber-dev/2022-October/007528.html
[2] =
https://docs.oracle.com/en/java/javase/19/language/pattern-matching.html#GUID-3EEBECEA-D874-4B20-B46B-07ED6172881D
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20230317/a330eb68/attachment-0001.htm>
More information about the amber-dev
mailing list