What happened to primitive classes?
Julian Waters
tanksherman27 at gmail.com
Thu Jun 15 12:37:20 UTC 2023
Well, that's a shame. I was just about to ask about "mutability" on
primitive classes ("Mutability", much in the same way that int i; can later
be reassigned by i = 7;) until I saw that change. Unless these new combined
value and primitive classes are similar enough to have that discussion, at
least
On Mon, May 22, 2023 at 11:08 PM Remi Forax <forax at univ-mlv.fr> wrote:
>
>
> ------------------------------
>
> *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/20230615/11af55e4/attachment.htm>
More information about the valhalla-dev
mailing list