RFR: 8334248: Invalid error for early construction local class constructor method reference [v3]

Maurizio Cimadamore mcimadamore at openjdk.org
Tue Jun 18 10:26:11 UTC 2024


On Mon, 17 Jun 2024 21:57:03 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:

> I'm sure you're probably right but I'm not sure I fully grok this. It seems like the only correct place to set the flag (a) to true is at the start of the constructor, and (b) to false is after processing the superclass constructor invocation parameters. But it may very well be that the flag itself is stored in the wrong place, which I think is what you are saying... ?

I agree with (a) and (b). But note that the flag is also (c) set to false inside `Attr::visitClassDef`. I believe this was done to avoid an inner class "inherit" the state from the parent class. But the operation of setting the flag to false occurs on the same "env" as the _enclosing_ class (as we have not yet accessed/created the env for the inner class, that will happen in `Attr::attribClass`). I think this is probably solved by just moving the code for (c) around.

> OK, unfortunately I'm not confident I can tackle all that myself (I don't even fully understand it completely). Would love for you to take the wheel if you can - as long as all the tests I've been running still pass then I'll be OK with whatever you come up with :) FWIW all current fixes & tests I've been working with (including your two refactorings) are [here](https://github.com/archiecobbs/jdk/tree/javac-pre-capture-fixes). Thanks.

I'm happy to take a look.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/19705#issuecomment-2175751067
PR Comment: https://git.openjdk.org/jdk/pull/19705#issuecomment-2175751953


More information about the compiler-dev mailing list