What happened to primitive classes?

Remi Forax forax at univ-mlv.fr
Mon May 22 15:08:31 UTC 2023


> From: "Julian Waters" <tanksherman27 at gmail.com>
> To: "valhalla-dev" <valhalla-dev at openjdk.org>
> Sent: Monday, May 22, 2023 4:41:59 PM
> Subject: What happened to primitive classes?

> Sorry if this is a silly question, but I recently browsed through JEP-401 to
> find that all references to primitive classes have been completely scrubbed, as
> if they were never there at all. I haven't been keeping up to date with
> Valhalla lately, so I can't tell what the changes (if any) have been. Did they
> move elsewhere or were they changed to something else?

Yes, all values classes are now nullable by default. 
The equivalent of the old primitive class is a non-nullable value class with a default instance. 

If you declare the value class Range like the first example of the JEP-401, Range! (not the '!') is what is the closest to the old primitive class. 

> best regards,
> Julian

regards, 
Rémi 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/valhalla-dev/attachments/20230522/7dde0d25/attachment.htm>


More information about the valhalla-dev mailing list