<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Indeed, on second thought, this just does not extend record canonical constructors, but does not remove any ability. We can have a separate migration mechanism for record constructors in a later release.</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Archie Cobbs <archie.cobbs@gmail.com><br>
<b>Sent:</b> Wednesday, April 23, 2025 12:02 PM<br>
<b>To:</b> Chen Liang <chen.l.liang@oracle.com><br>
<b>Cc:</b> forax@univ-mlv.fr <forax@univ-mlv.fr>; amber-spec-experts <amber-spec-experts@openjdk.java.net>; amber-spec-comments <amber-spec-comments@openjdk.org><br>
<b>Subject:</b> Re: [External] : Re: Draft Spec for Flexible Constructor Bodies (JEP 513)</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">On Tue, Apr 22, 2025 at 6:54 PM Chen Liang <<a href="mailto:chen.l.liang@oracle.com">chen.l.liang@oracle.com</a>> wrote:</div>
<div class="x_gmail_quote x_gmail_quote_container">
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div class="x_msg7537803375376809831">
<div dir="ltr">
<div style="font-family:"Calibri Light","Helvetica Light",sans-serif; font-size:12pt; color:rgb(0,0,0)">
However, one problem with FCB I see that can block its finalization is its lack of support for records - records must not have a superconstructor invocation, and as a result, records cannot have early construction field assignments, because without an explicit
invocation, per JLS, the canonical constructor body will be late construction; and such a body can use "this", which makes it incompatible to simply reinterpret a canonical constructor body as in an early construction context.</div>
</div>
</div>
</blockquote>
<div><br>
</div>
</div>
<div class="x_gmail_quote x_gmail_quote_container">I don't claim to be an impartial observer, but in my opinion this issue should not be a show-stopper for finalization of FCB.</div>
<div class="x_gmail_quote x_gmail_quote_container"><br>
</div>
<div class="x_gmail_quote x_gmail_quote_container">My rationale:</div>
<div class="x_gmail_quote x_gmail_quote_container"><br>
</div>
<div class="x_gmail_quote x_gmail_quote_container">1. Canonical record constructors already limit what you can do before super(): namely, anything that you can do within a super() call parameter list. So this is not a new problem.</div>
<div class="x_gmail_quote x_gmail_quote_container"><br>
</div>
<div class="x_gmail_quote x_gmail_quote_container">2. This restriction does become more acute with strict fields, but that just means it may need to be addressed along with strict fields (i.e., later). There are simple answers, e.g., allowing a parameterless
"super" keyword to demarcate the prologue/epilogue boundary, and which would syntactically mirror the parameterless constructor declaration.</div>
<div class="x_gmail_quote x_gmail_quote_container"><br>
</div>
<div class="x_gmail_quote x_gmail_quote_container">-Archie</div>
<div class="x_gmail_quote x_gmail_quote_container"><br>
</div>
<span class="x_gmail_signature_prefix">-- </span><br>
<div dir="ltr" class="x_gmail_signature">Archie L. Cobbs<br>
</div>
</div>
</div>
</body>
</html>