
Pattern matching in Java has evolved rapidly from instanceof patterns to record patterns and switch expressions. With recent Java releases, support for primitive types in patterns completes the picture, eliminating awkward boxing and unboxing ceremonies and enabling seamless matching across reference and primitive types alike.
This talk demystifies how primitives in patterns work under the hood from both language design and compiler perspectives: