<div dir="ltr"> Hi!<br>I am investigating a new version of jep440+441 <div>(<a href="https://cr.openjdk.org/~gbierman/jep440%2B441/jep440+441-20230612/specs/patterns-switch-record-patterns-jls.html" target="_blank">https://cr.openjdk.org/~gbierman/jep440%2B441/jep440+441-20230612/specs/patterns-switch-record-patterns-jls.html</a>)</div>and notice the next fact:<br>```<br>class Test22 {<br> enum E {A, B}<br><br> int testAll(Integer i, E e) {<br> switch (e) {<br> case E d when d.hashCode()==1:<br> return 1;<br> case A:<br> return -1;<br> case B:<br> return -2;<br> }<br> return 1;<br> }<br>}<br><div>```<br>this code produces an error: `java: unreachable statement`. It is expected, but this draft doesn't mention any changes about reachability. 14.22 contains the statement, that<br>```<br> A switch statement whose switch block consists of switch labeled statement
groups can complete normally if at least one of the following is true:<br>....
– The switch block does not contain a default label.
<br>```<br>According to it, this `switch` can complete normally.<br>Perhaps, something is missing in this draft or I can't find some changes.<br>Could you help me why according to the jep this switch cannot complete normally?</div></div>