<div dir="ltr"><div dir="ltr">On Thu, Jun 20, 2024 at 10:16 AM Maurizio Cimadamore <<a href="mailto:maurizio.cimadamore@oracle.com">maurizio.cimadamore@oracle.com</a>> wrote: <br></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><div><p style="margin:0px 0px 1.2em">The crucial
observation here is that there can be <i>multiple</i> valid
enclosing instances, and the innermost one might not be
available due to early construction context, so we need to be
able to skip that, and jump to the next</p></div></div></blockquote><div>Hah, that's a new one for me... :)</div><div><br></div><div>Just curious, your comment "the JLS text for member inner
class creation seems lacking" makes me wonder if this obscure corner already existed (i.e., before "flexible constructors") with the anonymous class equivalent:</div><div><p style="margin:0px 0px 1.2em"></p>
<pre style="font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;white-space:pre-wrap;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);display:block;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248)">class Outer2 {<br><br> Outer2() {<br> }<br><br> Outer2(Object obj) {<br> }<br><br> class InnerSuperclass {<br> { System.out.println(Outer2.this); }<br> }<br><br> static class InnerOuter extends Outer2 {<br> class InnerInnerOuter extends Outer2 {<br> InnerInnerOuter() {<br> super(new InnerSuperclass() { });<br> }<br> }<br> }<br><br> public static void main(String[] args) {<br> new InnerOuter().new InnerInnerOuter(); // prints "Outer2$InnerOuter@327471b5"<br> }<br>}
</code></pre>
</div><div>That program doesn't compile now but by the same argument maybe it should - or at least the same ambiguity already exists?<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><p style="margin:0px 0px 1.2em">I think that this
fix, coupled with the translation fixes I shared last week
should implement JEP 482 “as intended”</p></div></div></blockquote><div>Awesome, thanks for tackling this! Fyi, I've merged this patch into my <a href="https://github.com/openjdk/jdk/compare/master...archiecobbs:jdk:javac-pre-capture-fixes?expand=1">javac-pre-capture-fixes</a> branch (already includes your
lambda refactoring).</div></div><div class="gmail_quote"><br></div><div class="gmail_quote">-Archie</div><div class="gmail_quote"><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Archie L. Cobbs<br></div></div>