<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div>
<blockquote type="cite" class="">
<div class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
Ok, but there doesn't seem to be any way to say "only value classes can extend me!”</div>
</div>
</blockquote>
<br class="">
</div>
<div>At some level, this is a matter of taste and return-on-complexity. Obviously this is not _needed_, but some programmers are clearly comforted by the ability to capture this intent. Of course, adding such restriction adds complexity at every layer; it
needs a syntactic expression, it needs a clasfile representation, it needs static type checking, it needs dynamic enforcement, it needs reflection, etc. So the first question is: does the incremental expressiveness justify the incremental complexity? </div>
<div><br class="">
</div>
But more importantly, as Remi points out, seemingly harmless “intent capturing” things at the source level can turn into unexpected difficulties for longer term issues such as migration compatibility. We saw a similar example of this in Java 8, where people
asked “why can’t I make a default method final”, but then when you show them the impossible problems this creates for subclasses, they change the subject. Foreclosing on possibilities like this, that are often “over the maintenance horizon”, are often “shallowly
sensible” but make the ecosystem brittle.
<div class=""><br class="">
</div>
</body>
</html>