About a year ago, I came across a JEP that discussed a way to generalize types that can be used with pattern matching in switch statements or instanceof checks. As I recall, it involved implementing a "matcher" interface, which would allow these types to be utilized in pattern matching syntax. Lately, I've been trying to find that JEP but haven't had any luck—it's almost like I imagined it! Does this sound familiar to anyone? I think it was around the same time the preview for record patterns was released.
2 Answers
You might be referring to member patterns! Check out this link: [Member Patterns Design Notes](https://openjdk.org/projects/amber/design-notes/patterns/towards-member-patterns).
Also, there's a new concept called [Array/Varargs Patterns](https://mail.openjdk.org/pipermail/amber-spec-observers/2022-September/003635.html) that might come to Java in the future, although not necessarily in the form it's currently presented. Plus, there are recent explorations on member patterns worth a look: [Bikeshedding Member Patterns](https://mail.openjdk.org/pipermail/amber-spec-experts/2024-March/004082.html).
It sounds like there might not actually be a JEP for that yet. I think what you read was probably some design notes that mentioned potential directions but didn’t get developed into an official JEP.

Thanks for the link! Do you know what the current status of member patterns is?