On Wed, 3 Jun 2026 19:19:42 GMT, Vicente Romero <[email protected]> wrote:

> When dealing with strict fields with initializers at the time we track them 
> there is no constructor that we can use to later retrieve them at lowering 
> time. Those fields can drop on the floor and no proxies are created for them. 
> This PR fixes this issue,
> 
> TIA
> 
> 
> 
> 
> ---------
> - [X] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java line 4060:

> 4058:                 if (context.ctorPrologue()) {
> 4059:                     // Track the early read for codegen
> 4060:                     
> localProxyVarsGen.addFieldReadInPrologue(env.enclMethod != null ? 
> env.enclMethod : env.enclClass, field);

maybe worth pulling `env.enclMethod != null ? env.enclMethod : env.enclClass` 
in a separate local, for making the expression more readable?

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2507#discussion_r3351941313

Reply via email to