[lworld] RFR: 8342575: [lworld] Compiler should reject volatile fields in value classes
Vicente Romero
vromero at openjdk.org
Fri Nov 8 00:04:54 UTC 2024
On Thu, 7 Nov 2024 22:05:16 GMT, John R Rose <jrose at openjdk.org> wrote:
> Just checking: This logic applies only to non-static fields, right? When we discuss such things we typically omit specifying whether we are talking about static fields, non-static fields, or both kinds, and that can sometimes lead us to make mistakes in our thinking.
>
> Under the principle of preserving independence of language features, it should be possible for a value class to have a non-final or a volatile fields, **if** it is a static field.
>
> (An impulse to restrict static fields of value classes might well be the designer's siren song of "I never liked those and this is my chance to show them who's boss!")
yes this applies only no non-static fields, only instance fields are implicitly `final`
-------------
PR Comment: https://git.openjdk.org/valhalla/pull/1297#issuecomment-2463456956
More information about the valhalla-dev
mailing list