<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>"David Alayachew" <davidalayachew@gmail.com><br><b>To: </b>"valhalla-dev" <valhalla-dev@openjdk.java.net><br><b>Sent: </b>Tuesday, September 23, 2025 2:19:40 PM<br><b>Subject: </b>Question about Value Classes and inheritance<br></blockquote></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 dir="auto">Hello <span class="gmail_chip gmail_plusreply" dir="auto"><a href="mailto:valhalla-dev@openjdk.java.net" style="color:#15c;text-decoration:underline" target="_blank">@valhalla-dev</a></span>,<div dir="auto"><br></div><div dir="auto">I read through JEP 401, and the subsection about subtyping surprised me.</div><div dir="auto"><br></div><div dir="auto">It appears that Abstract Value Classes can permit both Value child classes and Identity child classes. The example of BigInteger helps explain why.</div><div dir="auto"><br></div><div dir="auto">Ok, but there doesn't seem to be any way to say "only value classes can extend me!"</div><div dir="auto"><br></div><div dir="auto">Why is that?</div><div dir="auto"><br></div><div dir="auto">And to be clear, I am not bothered by Abstract Value Classes permitting Identity children, that's fine.</div></div></blockquote><div><br></div><div>I'm glad this is fine by you because it's important for backward compatibility, it means that you can declare an existing abstract class has "value enable", without requiring sub-classes to be changed.</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 dir="auto"><div dir="auto"> I'm moreso confused by lack of ability to say "only value children".</div></div></blockquote><div><br></div><div>Declaring a class has a value class is really close to be an implementation detail (it mainly depends on if your code abuse of == or not),</div><div>so why do you want such ability ?</div><div><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 dir="auto"><div dir="auto"><br></div><div dir="auto">Thank you for your time and consideration.</div><div dir="auto">David Alayachew</div></div></blockquote><div><br></div><div>regards,</div><div>RĂ©mi</div><div><br data-mce-bogus="1"></div></div></div></body></html>