<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>On 13. 12. 23 13:49, <a class="moz-txt-link-abbreviated" href="mailto:forax@univ-mlv.fr">forax@univ-mlv.fr</a> wrote:</p>
<div class="moz-cite-prefix">[snip]<br>
</div>
<blockquote type="cite" cite="mid:1882982839.81146561.1702471762200.JavaMail.zimbra@univ-eiffel.fr">
<div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><br>
<div data-marker="__QUOTED_TEXT__">
<blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;">
<blockquote cite="mid:327307323.80228032.1702420883408.JavaMail.zimbra@univ-eiffel.fr">
<div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000">
<div>
<blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;">
Exception cases have the obvious dominance order
with other exception cases (the<br>
same one used to validate order of `catch` clauses
in `try-catch`), and do not<br>
participate in dominance ordering with
non-exceptional cases. It is a<br>
compile-time error if an exception case specifies an
exception type that cannot<br>
be thrown by the selector expression, or a type that
does not extend<br>
`Throwable`. For clarity, exception cases should
probably come after all other<br>
non-exceptional cases. <br>
<br>
When evaluating a `switch` statement or expression,
the selector expression is<br>
evaluated. If evaluation of the selector expression
throws an exception, and<br>
one of the exception cases in the `switch` matches
the exception, then control<br>
is transferred to the first exception case matching
the exception. If no<br>
exception case matches the exception, then the
switch completes abruptly with<br>
that same exception. </blockquote>
<div><br>
</div>
<div>I don't want to be the guy implementing this :)</div>
</div>
</div>
</blockquote>
<br>
Good news, Jan has volunteered to be that guy :)</blockquote>
<div><br>
</div>
<div>Are you sure you do not want a VM guy too ?<br data-mce-bogus="1">
</div>
</div>
</div>
</blockquote>
<p><br>
</p>
<p>FWIW, we already run in the "try-catch with values on stack"
problem in the case of a try-catch inside a switch expression. The
current solution is to stash the stack to locals (which I suspect
is similar to what you did in your case). It is not very pretty,
but I think we can start with this and see if it poses problems in
practice.</p>
<p><br>
</p>
<p>(I am a bit more concerned about the switch-with-case-throws used
as a conditional e.g. in an if - that may be tricky, as the code
needs to have some particular shape. I think we have some ideas on
how to implement that in the compiler, but didn't try them yet.)</p>
<p><br>
</p>
<p>Jan<br>
</p>
<p><br>
</p>
</body>
</html>