New candidate JEP: 455: Primitive types in Patterns, instanceof, and switch (Preview)


Enhance pattern matching by allowing primitive type patterns to be used in all pattern contexts, align the semantics of primitive type patterns with that of instanceof, and extend switch to allow primitive constants as case labels. This is a preview language feature …

More at https://openjdk.org/jeps/455