<div dir="ltr"><div class="gmail_default" style="font-family:monospace">Hello,</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">For whatever reason, I remember seeing this as another potential future direction for Java.</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">$ build/windows-x86_64-server-release/images/jdk/bin/jshell --enable-preview<br>|  Welcome to JShell -- Version 21-internal<br>|  For an introduction type: /help intro<br><br>jshell> sealed interface ABC {<br>   ...>     enum A implements ABC {Z}<br>   ...>     record B(A a) implements ABC {}<br>   ...>     record C(A a, B b) implements ABC {}<br>   ...> }<br>|  created interface ABC<br><br>jshell> final ToIntFunction<ABC> d =<br>   ...> abc -><br>   ...> switch (abc) {<br>   ...>     case C(A.Z, B(A.Z)) -> 1;<br>   ...>     default -> 0;<br>   ...> };</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">I think it was called constant patterns?</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">Thank you for your time!</div><div class="gmail_default" style="font-family:monospace">David Alayachew<br></div></div>