Uniform Handling of failure in switch -- Exhaustiveness on Exceptions?
David Alayachew
davidalayachew at gmail.com
Mon Jan 1 07:11:54 UTC 2024
Hello Amber Dev Team,
I read Brian Goetz's "Case Effect on Switch" (looks like it recently got
renamed to "Uniform handling of failure in switch"), and I have a quick
question.
I think it's cool to bring error handling into switch, but will we still
get the exhaustiveness/totality on checked exceptions that we are used to
on the try catch side?
I feel like it would be weird and unintuitive if it didn't, since switch
expressions already give us exhaustiveness/totality, and that's basically
the biggest reason to use a switch expression in the first place. Leaving
it out for exceptions would just feel mean. Plus, having this feature would
really help with clarifying intent and with readability.
Thank you for your time and help!
David Alayachew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20240101/3df05a32/attachment.htm>
More information about the amber-dev
mailing list