<div dir="ltr">Hello,<div><br></div><div>First, please excuse me for the way I send this bug report. I cannot find a way to report it in other ways.</div><div><br></div><div>Looking at the description of JEP 405, it made me think of Rust enums and pattern matching.</div><div>I tried then to play on how to write a copy of the Rust "Option" enum : <a href="https://gist.github.com/grimly/55d414f0cc3395e87a7c813176c50ac9">https://gist.github.com/grimly/55d414f0cc3395e87a7c813176c50ac9</a></div><div><br></div><div>But then I encountered this issue when narrowing the types I use and in this particular instance ( <a href="https://gist.github.com/grimly/55d414f0cc3395e87a7c813176c50ac9#file-testfailing-java-L9-L12">https://gist.github.com/grimly/55d414f0cc3395e87a7c813176c50ac9#file-testfailing-java-L9-L12</a> ), the compiler throws an error and reports the switch is not exhaustive.</div><div><br></div><div>Given in my code "Option" is sealed and may only be "Some" or "None", I would expect listing both options to make my cases exhaustive.</div><div>Adding a default case, I also fail to produce an instance that would trigger it.</div><div><br></div><div>Best regards,</div><div>Michel</div><div><br>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><p><span style="color:#1f497d">Michel TURPIN<br></span></p></div></div></div></div></div>