<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div><br></div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Robbe Pincket" <robbepincket@live.be><br><b>To: </b>"Valhalla Expert Group Observers" <valhalla-spec-observers@openjdk.org>, "Remi Forax" <forax@univ-mlv.fr><br><b>Sent: </b>Thursday, July 21, 2022 11:35:13 PM<br><b>Subject: </b>RE: The storage hint model<br></blockquote></div><div><style><!--
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style></div><div data-marker="__QUOTED_TEXT__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"> <br> On Thu Jul 21 21:15:23 UTC 2022, Rémi wrote:<br><br> <br><br> > Differences between C and C.val is really hard to understand because those types are really similar but obey to different rules<br><br> > - C and C.val have no subtyping relationship but if you see a type as a set, C accept null while C.val don't.<br><br> > - you have auto-boxing between a C and a C.val<br><br> > - overloading rules should prefer C.val to C (but maybe not)<br><br> > - the inference with C.val doe not work exactly like the inference with C<br><br> > - an array of C.val is a subtype of an array of C<br><br> > - List<C> and List<C.val> are incompatible types<br><br> > - instanceof C.val is not valid<br><br> > - c.getClass() with c a C.val is typed Class<? extends C> (not C.val).<br><br> <br><br> I thought `c.getClass()` wasn't gonna be valid, just like you can't do `i.getClass()` where `i` is an int.</blockquote><div><br></div><div>You may be right, i think Kevin is a proponent of that idea. <br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><br><br> <br><br> > and this is not an exhaustive list and I'm sure some of them are wrong because even us, experts, have trouble to define the correct set of rules.<br><br> <br><br> > Basically, it's a mess because we are creating a new kind of types, C.val, that sometimes works like a primitive (hence boxing, overloading, type inference) but sometimes works like an objet (has Object as super class, have an adhoc way to work with wildcards, etc). And then as a user, there is there is the looming question about where to use C vs C.val, which is will be like a long words essay full of particular cases (like the Angelika Langer FAQ for generics).<br><br> <br><br> I'm a bit confused here. `C.val` doesn't extend `Object` afaik. Just like primitives `C.val` has a boxed version `C` that does extend `Object`, much like `int` to `Integer` now.</blockquote><div><br></div><div>You can call methods on a C.val, so it's an object, it may not directly extends of java.lang.Object like an interface does not extend java.lang.Object but you can call toString() on it.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><br><br> <br><br> <br><br> I'm gonna be honest, I'm very confused with the `.box`/`.flat` discussions.</blockquote><div><br></div><div>given that we are in a phase of throwing things and see what's stick, don't worry :)<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><br><br> <br><br> Greetings<br><br> Robbe<br><br></blockquote><div><br></div><div>Rémi<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div></div></div></body></html>