<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">On 14/06/2024 18:04, Archie Cobbs
wrote:<br>
</div>
<blockquote type="cite" cite="mid:CANSoFxvHT1FuonSM3KLYbN+Q6dAak_5AvMWFLjgcVYNa6Cwj7g@mail.gmail.com">Your
change to the semantics of <span style="font-family:monospace">hasOuterInstance()</span>
happens to invalidate my <a href="https://urldefense.com/v3/__https://github.com/openjdk/jdk/pull/19705/files*diff-ce037c979a568d769d3064d15f94a75cd0311e3e0a9e7899f59d4f9283ad6ea8__;Iw!!ACWV5N9M2RV99hQ!L-9GAxHAzJt6lxEoIcD-NgGJuM7uictTascht11Ui5uc02DZuGr2sDg5IWBSv_Ei2Gq59ZhAZQhMq9hvL4QIKLPqhvnscg$" target="_blank" moz-do-not-send="true">fix for JDK-8334248</a>
but that's OK, the new semantics are more correct and I've
rewritten my fix to instead check for NOOUTERTHIS directly.</blockquote>
<p>Thanks. I wonder... is the real problem here that
Resolve::resolveImplicitThis doesn't skip over classes that have
NOOUTERTHIS set? E.g. your patch just disables the check if we see
NOOUTERTHIS... which is ok if the current class happens to have NO
accessible enclosing instances. But what if there's *some*
accessible enclosing instance?</p>
<p>Something like this:</p>
```java<br>
class Outer {<br>
void m() { }<br>
<br>
class Inner {<br>
Inner() {<br>
class Foo { void g() { m(); } }<br>
super();<br>
class Bar { static void r() { new Foo(); } };<br>
}<br>
}<br>
}<br>
<p>```</p>
<p>Btw, it seems like this code crashes javac (even with both
patches applies). I don't think this code should be allowed at all
(you can't create the local Foo from the static Bar::r). So, this
is related to the bug you mentioned, and I believe we need checks
for the innermost accessible enclosing instance here.</p>
<p>Maurizio<br>
</p>
<p> <br>
</p>
<p> <br>
</p>
</body>
</html>