r/java • • 17d ago

Withdrawing the Primitive Patterns preview feature in JDK 28

https://mail.openjdk.org/archives/list/amber-spec-experts@openjdk.org/thread/UYEK3PGOHN6R56AHJTSLPGAY363K666S/

Primitive Types in Patterns will be removed in JDK 28 and will no longer be available in that release.

The Valhalla project has been exploring a new vision for Java numerics, including the possibility of user-defined numeric types. New kinds of numeric types would need to support exact numeric conversion, and vice versa. Given that the Valhalla work is still evolving, it would be premature to finalize Primitive Types in Patterns with their current definition of exact numeric conversion.

94 Upvotes

36 comments sorted by

View all comments

Show parent comment

0

u/pjmlp 11d ago

Thanks for the reply, what has put me off, was the whole initial approach, and the name "witness types" for what everyone else calls traits or type classes.

It was rather confusing to get where this naming came from, and as someone that enjoys reading SIGPLAN papers I am not sure where in type theory they come from either.

It was a bit like when Stable Values where proposed, even though everyone else calls them lazy values, which lazy constants sound much more closer to.