<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>"Brian Goetz" <brian.goetz@oracle.com><br><b>Cc: </b>"Valhalla Expert Group Observers" <valhalla-spec-observers@openjdk.org>, "Kevin Bourrillion" <kevinb@google.com><br><b>Sent: </b>Wednesday, July 27, 2022 9:37:21 PM<br><b>Subject: </b>RE: Question about universal type variables<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;">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-GB">On Wed Jul 27 19:22:51 UTC 2022, Brian Goetz wrote:</span></p>
<p class="MsoNormal"><span lang="EN-GB">> It is a type of indeterminate ref-ness or val-ness. This will have both
</span></p>
<p class="MsoNormal"><span lang="EN-GB">restrict some old behavior and provide some new behavior. For example:</span></p>
<p class="MsoNormal"><span lang="EN-GB">> </span></p>
<p class="MsoNormal"><span lang="EN-GB">> T t = null;</span></p>
<p class="MsoNormal"><span lang="EN-GB">> </span></p>
<p class="MsoNormal"><span lang="EN-GB">> will generate an unchecked warning, since we can't be sure we're not
</span></p>
<p class="MsoNormal"><span lang="EN-GB">polluting the heap with nulls.</span></p>
<p class="MsoNormal"><span lang="EN-GB">I seem to remember there being talks about `IdentityObject` and `ValueObject` interfaces or something similar, is this still planned. </span></p></div></blockquote><div><br></div><div>No, it's not anymore.<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;"><div class="WordSection1"><p class="MsoNormal"><span lang="EN-GB">If so, would the warning go away if `T` has a typebound of `IdentityObject` and become
an error if it has a typebound of `ValueObject`</span></p>
<p class="MsoNormal"><span lang="EN-GB">Regards</span></p>
<p class="MsoNormal"><span lang="EN-GB">Robbe Pincket</span></p>
</div></blockquote><div><br></div><div>There are still cases where because of the bound of the type variable, a value class is not possible</div><div>- if the bound is a class<br data-mce-bogus="1"></div><div>- if the bound is an abstract class with at least a constructor.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>but i'm not sure it's a good idea to change the type checking depending on those property.<br></div><div><br></div><div>regards,<br data-mce-bogus="1"></div><div>Rémi<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div></div></div></body></html>