Proposed to target JDK 27: JEP 532: Primitive Types in Patterns, instanceof, and switch (Fifth Preview): https://openjdk.org/jeps/532 #jdk27 #openjdk #java
Instanceof on a primitive type will now be possible, and it will do a range check? Neat!
#Rust did something similar a few years ago when they introduced the TryFrom trait.