<div dir="auto">Checked exceptions will remain totally checked.<div dir="auto"><br></div><div dir="auto">Given a function f, let checkF be the set of checked exceptions, then the expression:</div><div dir="auto"><br></div><div dir="auto">switch(root(args)) {</div><div dir="auto"> case branch0 -> do0(args);</div><div dir="auto"> case branch1 -> do1(args);</div><div dir="auto"> ...</div><div dir="auto"> case branch1 -> doN(args);</div><div dir="auto"> case throws fBranch0 -> handle0(args);</div><div dir="auto"> case throws fBranch0 -> handle1(args);</div><div dir="auto"> ...</div><div dir="auto"> case throws fBranch0 -> handleM(args);</div><div dir="auto">}</div><div dir="auto"><br></div><div dir="auto">Will have the following set of checked exceptions:</div><div dir="auto"><br></div><div dir="auto"> (checkRoot - {fBranch0, ... fBranchM}) + checkDo0 + ... + checkDoN + checkHandle0 + ... + checkHandleM</div><div dir="auto"><br></div><div dir="auto">Where minus is set difference and plus is union</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 1 Jan 2024, 09:12 David Alayachew, <<a href="mailto:davidalayachew@gmail.com">davidalayachew@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:monospace">Hello Amber Dev Team,</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">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.</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">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?</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">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.</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">Thank you for your time and help!</div><div class="gmail_default" style="font-family:monospace">David Alayachew<br></div></div>
</blockquote></div>