You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A consequence of liberalizing the initialization of static variables has been that final static variables are not reliably constant anymore. Const variables were introduced to compensate for this.
The language spec requires that variables be declared const to be treated as compile time constants, and that final variables not be treated as compile-time constants. See spec sections 5 & 10.1.
I would expect us to pursue a staged approach: first allow const variables, then revise our libraries, then revoke the constant status of static final variables (and then implement lazy initialization).
The text was updated successfully, but these errors were encountered:
A consequence of liberalizing the initialization of static variables has been that final static variables are not reliably constant anymore. Const variables were introduced to compensate for this.
The language spec requires that variables be declared const to be treated as compile time constants, and that final variables not be treated as compile-time constants. See spec sections 5 & 10.1.
I would expect us to pursue a staged approach: first allow const variables, then revise our libraries, then revoke the constant status of static final variables (and then implement lazy initialization).
The text was updated successfully, but these errors were encountered: