Possible records tweak
Guy Steele
guy.steele at oracle.com
Wed Apr 29 19:44:14 UTC 2020
> On Apr 29, 2020, at 3:13 PM, Dan Smith <daniel.smith at oracle.com> wrote:
>
> . . .
> This is all compile-time.
>
> The status quo in Java is that to assign to a final field at compile time, you need to do all of the following:
> - Be in a constructor for the same class
> - Reference the field using an unqualified name or qualified by 'this'
> - Use a simple assignment expression (fieldref = expr)
> - Place the assignment at a point where the field is DU (has not yet been assigned to through any local control flow path)
>
> All other references to the field as an lvalue will be compile-time errors.
Okay, thanks. (Clearly you DO have it all swapped into your head!)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/amber-spec-experts/attachments/20200429/c2cc0e04/attachment-0001.htm>
More information about the amber-spec-experts
mailing list