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

Archie Cobbs acobbs at openjdk.org
Mon Jun 17 22:00:11 UTC 2024


On Mon, 17 Jun 2024 20:43:44 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> The problem is that I don't think there's a new env creation in visitClassDef. This calls Attr::attribClass which is where the new env is fetched/created. So I think maybe you need to move the place where you set the flag to false?

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 think two things need to happen...

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.

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

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


More information about the compiler-dev mailing list