Different handing of "this" vs. "MyClass.this" in definite assignment
Archie Cobbs
archie.cobbs at gmail.com
Tue Dec 6 14:33:25 UTC 2022
On Fri, Dec 2, 2022 at 2:47 PM Brian Goetz <brian.goetz at oracle.com> wrote:
> >> Presumably the reason for the different treatment is because in general
> the qualifying expression could be arbitrarily complex and the compiler
> can't be expected to detect any possible qualification in front of "foo",
> so why even start down that road?
> > Exactly. Don’t start down that road, unless (1) you know where it goes,
> and (2) that it gets somewhere good, and (3) you can get there before you
> run out of gas. Don’t start just because you like the first billboard you
> see, or on a road which takes you to a tarpit, or with only enough supplies
> to travel on the first day of a week-long trip. I think we might have all
> three problems here.
>
> I think there are two different perspectives on `MyClass.this.x` that
> lead to two different views of the world.
>
> ....
>
> But I agree overall that this isn't worth spending a lot of
> spec-revision currency on.
>
It sounds like there is agreement to leave the spec alone for the time
being.
I'll retract my PR and leave it up to others to update and/or resolve
JDK-8193904.
Thanks again for all the good discussion.
-Archie
--
Archie L. Cobbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20221206/51adf32e/attachment-0001.htm>
More information about the amber-dev
mailing list