It starts with a bang ends with a quote
Dan Smith
daniel.smith at oracle.com
Tue May 21 14:49:30 UTC 2024
On May 21, 2024, at 1:09 AM, Remi Forax <forax at univ-mlv.fr> wrote:
Hello,
I recently tried to convince myself that using a type annotation (the bang '!') was the best way to do type specialization at langage level but I still find it awkward.
There are several reasons why using a bang to ask for type specialization does not work well with the rest of the design of value types.
We've considered lots of different variations on specialization, so to be clear: you're critiquing an approach in which Foo<Val!> is specialized, while Foo<String> and Foo<Val> are not. Is that right?
I think we're going to end up with a stronger requirement: that Foo<Val!> and Foo<Val> must *both* be specialized. (My inclination has always been to throw Foo<String> in there, too, but that one is more negotiable.)
Why specialize Foo<Val>? Because we can often still flatten the storage (we're including some flattening of nullable value class types in JEP 401), and in any case we should always scalarize specialized method signatures for value class types.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/valhalla-spec-observers/attachments/20240521/8822a1a5/attachment-0001.htm>
More information about the valhalla-spec-observers
mailing list