<div dir="ltr">IntelliJ IDEA can do this in simple cases (use 'Create missing branches' action in Alt+Enter menu on "statement does not cover all possible input values" error message). From what I remember, it could be very non-trivial to determine a minimal set of missing branches in a general case, especially if you have generic parameters and nested deconstruction patterns. I'm not sure but probably it's an NP-complete problem.<div><br></div><div>With best regards,</div><div>Tagir Valeev.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 30, 2024 at 6:40 AM David Alayachew <<a href="mailto:davidalayachew@gmail.com">davidalayachew@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);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">The previous discussions on Checked Exceptions reminded me about this.</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">Is there any possible future where sealed types will be able to tell you which permitted subtypes are missing?</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">This is actually one of the sleeper features of Checked Exceptions -- they don't just give you exhaustiveness, they are even nice enough to tell you exactly which Exception type you left out.</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">This is a godsend for maintenance, fearless refactoring, and general correctness.</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">Any chance we could get this for sealed types in the future?</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>