[lworld] RFR: 8342575: [lworld] Compiler should reject volatile fields in value classes

Vicente Romero vromero at openjdk.org
Thu Nov 7 21:22:25 UTC 2024


On Thu, 7 Nov 2024 21:16:21 GMT, Vicente Romero <vromero at openjdk.org> wrote:

> programs like:
> 
> 
> value class V {
>     volatile int f = 1;
> }
> 
> 
> should be rejected by javac as instance fields of value classes are implicitly final and according to the `JLS 23`, `8.3.1.4 volatile Fields`:
> 
> It is a compile-time error if a final variable is also declared volatile

\integrate

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

PR Comment: https://git.openjdk.org/valhalla/pull/1297#issuecomment-2463231285


More information about the valhalla-dev mailing list