<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
Hi,<br>
<br>
I think that given that we are so close to closing the development
for 20 that we push this early on 21 after the fork for 20 has been
done,<br>
<br>
Thanks,<br>
Vicente<br>
<br>
<div class="moz-cite-prefix">On 11/28/22 12:45, Archie Cobbs wrote:<br>
</div>
<blockquote type="cite" cite="mid:CANSoFxv9mMoCaTvAOBR08TkuNooft2kBeTEft7fDFtJOWGjuNw@mail.gmail.com">
<div dir="ltr">
<div dir="ltr">
<div>It looks like nobody wants to do anything about this
issue.</div>
<div><br>
</div>
<div>If that's the case, could someone please close <a href="https://bugs.openjdk.org/browse/JDK-8193904" moz-do-not-send="true">JDK-8193904</a> (and then I'll
retract my PR)?<br>
</div>
<div><br>
</div>
<div>Thanks,</div>
<div>-Archie<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Fri, Nov 18, 2022 at 9:49
AM Archie Cobbs <<a href="mailto:archie.cobbs@gmail.com" moz-do-not-send="true" class="moz-txt-link-freetext">archie.cobbs@gmail.com</a>>
wrote:<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 dir="ltr">
<div dir="ltr">On Wed, Nov 2, 2022 at 3:18 PM Archie Cobbs
<<a href="mailto:archie.cobbs@gmail.com" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">archie.cobbs@gmail.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 dir="ltr">On Wed, Nov 2, 2022 at 2:47 PM Alex
Buckley <<a href="mailto:alex.buckley@oracle.com" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">alex.buckley@oracle.com</a>>
wrote:<br>
<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">JLS ch.16 is
specific that only `foo` and `this.foo` cause an
error. See <br>
the definition of "access" in the opening
paragraphs of the chapter.<br>
</blockquote>
<div><br>
</div>
<div>
<div dir="ltr">
<div>Thanks for pointing that out, which I
forgot to do. The JLS language is:</div>
<div><br>
</div>
<div style="margin-left:40px">An access to its
value consists of the simple name of the
variable (or, for a field, the simple name
of the field qualified by <code>this</code>)
occurring anywhere in an expression except
as the left-hand operand of the simple
assignment operator <code>=</code>
<code></code></div>
<div><br>
</div>
<div>In theory one could argue that MyClass<span style="font-family:monospace">.this.foo</span>
is also an example of "the simple name of
the field qualified by <code>this<span style="font-family:arial,sans-serif">" -
just look at the latter part, no?</span><br>
</code></div>
<div><code><br>
</code></div>
Regardless, it looks like there needs to be a
spec change... right? I'm assuming we'd rather
do that than continue to allow the current
behavior.</div>
</div>
</div>
</div>
</blockquote>
<div> </div>
</div>
<div>Any further thoughts on this one?</div>
<div><br>
</div>
<div>It seems to me that regardless of what you think the
right answer is, the current situation could use some
improvement.<br>
</div>
<div><br>
</div>
<div>Here's how the compiler currently behaves:</div>
<div><br>
</div>
<div style="margin-left:40px"><span style="font-family:monospace">// This class compiles
without error<br>
</span></div>
<div style="margin-left:40px"><span style="font-family:monospace">public class Example1 {</span><br>
<span style="font-family:monospace"> final int foo;</span><br>
<span style="font-family:monospace"> public
Example1() {</span><br>
<span style="font-family:monospace">
System.err.println(Example1.this.foo); // no error
generated here</span><br>
<span style="font-family:monospace"> this.foo =
42;</span><br>
<span style="font-family:monospace"> }</span><br>
<span style="font-family:monospace">}</span><br>
<span style="font-family:monospace"></span></div>
<div style="margin-left:40px"><span style="font-family:monospace"><br>
</span></div>
<div style="margin-left:40px"><span style="font-family:monospace">// This class fails to
compile<br>
</span></div>
<div style="margin-left:40px"><span style="font-family:monospace">public class Example2 {<br>
private final int foo;<br>
public Example2() {<br>
Example2.this.foo = 42; // "cannot assign a
value to final variable foo"<br>
}<br>
}<br>
</span></div>
<div><br>
</div>
<div>My thoughts...</div>
<div>
<ul>
<li>If the compiler is not following the spec, then we
need to fix the compiler</li>
<li>If the compiler is following the spec, then
shouldn't the spec be corrected so that it treats <span style="font-family:monospace">Foo.this</span> and
<span style="font-family:monospace">this</span> the
same way?<br>
</li>
</ul>
</div>
<div>In another email Alex said:</div>
<div>
<blockquote class="gmail_quote" style="margin:0px 0px
0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">DU/DA analysis is
about whether names have bindings. `x.foo` and `new <br>
</blockquote>
<div class="gmail_quote"><span>
<blockquote class="gmail_quote" style="margin:0px
0px 0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
C().foo` and `m().foo` are expressions, not names,
so we don't attempt <br>
the analysis on them. As Jan points out [1],
access via expressions is <br>
hard to track. `this.foo` is an expression, but a
very easy one, so we <br>
treat it like the name `foo` and do the analysis.
`A.B.C.this.foo` is an <br>
expression with a qualified-this subexpression and
now you need a bunch <br>
of analysis to figure out whether it means the
same as the name `foo`.</blockquote>
</span></div>
</div>
<div><br>
</div>
<div>I don't see that you "need a bunch of analysis". The
required analysis is already being done, for example,
when handling expressions that could refer to outer
'this' instances. We're not talking about arbitrarily
complex expressions. The only two options are 'this' or
'this' qualified by a type name.<br>
</div>
<div><br>
</div>
<div>Apologies if I'm missing something, just trying to
understand what the issue is here.<br>
</div>
</div>
</blockquote>
</div>
<br>
-- <br>
<div dir="ltr" class="gmail_signature">Archie L. Cobbs<br>
</div>
</div>
</blockquote>
<br>
</body>
</html>