<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<font size="4"><font face="monospace">So, its possible that #3 also
has reasonable cost/benefit. The current "pinch point" approach
could probably be brought to bear on it with modifications,
without having to thread everything through DA. But I think
there are subtleties to think through first. <br>
<br>
For example, would this be allowed?<br>
<br>
class A { <br>
final int a;<br>
<br>
A() { this.a = 0; }<br>
}<br>
<br>
class B extends A { <br>
B() { <br>
this.a = 1;<br>
super();<br>
}<br>
}<br>
<br>
The current draft JEP says it would:<br>
<br>
<blockquote type="cite"><font size="4"><font face="monospace">Add
the following restrictions on constructors:<br>
No access to this, other than assignments to fields,
may occur unless this is DA<br>
</font></font></blockquote>
<br>
This is clearly an "assignment to a field", but I think we can
agree that the code above is pretty dodgy. <br>
<br>
So what I'm proposing is to address the feature that everyone
likes and we agree can be addressed with less fuss, and then
consider coming back for more later. <br>
<br>
</font></font><br>
<div class="moz-cite-prefix">On 1/26/2023 12:13 PM, Archie Cobbs
wrote:<br>
</div>
<blockquote type="cite" cite="mid:CANSoFxvcKVxr5YWFMUgqmP44+oM-E=zmYRqJXUWteWoVLtMORg@mail.gmail.com">
<div dir="ltr">
<div dir="ltr">On Thu, Jan 26, 2023 at 10:59 AM Brian Goetz <<a href="mailto:brian.goetz@oracle.com" moz-do-not-send="true" class="moz-txt-link-freetext">brian.goetz@oracle.com</a>>
wrote:</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div> <font size="4"><font face="monospace">As we look at
the implications of this, though, we start to see that
the cost/risk/complexity keeps cropping up in the
lower-value aspects. To summarize, here are the
things you originally proposed to align:<br>
<br>
- Allowing statements before the this/super;<br>
- Choosing different super/this ctors in different
paths;<br>
- Initializing fields prior to this being DA.<br>
</font></font></div>
</blockquote>
<div><br>
</div>
<div>I think we all agree on #1.</div>
<div><br>
</div>
I agree that #2 is "niche" and therefore should be included
ONLY if it's not the singular cause of a bunch of additional
spec noise. Personally I "believe" you (air quotes) that it
would be, but also want to see for myself... I'm sure you'll
be proved right... and for now will leave that to others to
argue.<br>
<div><br>
</div>
<div>Seems like there's still some valid debate (not just from
me) about #3 though... ?<br>
</div>
</div>
<div class="gmail_quote"><br>
</div>
<div class="gmail_quote">-Archie</div>
<div class="gmail_quote"><br>
</div>
-- <br>
<div dir="ltr" class="gmail_signature">Archie L. Cobbs<br>
</div>
</div>
</blockquote>
<br>
</body>
</html>