On Fri, 17 Oct 2025 22:26:11 GMT, Vicente Romero <[email protected]> wrote:

> For code like:
> 
> 
> value class Test {
>     static class Foo {
>         int x;
>         int getX() { return x; }
>     }
>     private final Foo data = new Foo();
>     Test() {
>         data.getX();
>         super();
>     }
> }
> 
> 
> javac generates code corresponding to the initialization of field `data` 
> twice, which is incorrect

Can we just append the variable initializers to the initBlocks in the 
`(sym.flags() & STATIC) == 0` branch in normalizeDefs?

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

PR Comment: https://git.openjdk.org/valhalla/pull/1686#issuecomment-3423238688

Reply via email to