RFR: 8324651: Compiler Implementation for Derived Record Creation (Preview) [v5]
Maurizio Cimadamore
mcimadamore at openjdk.org
Fri Apr 5 12:58:10 UTC 2024
On Thu, 4 Apr 2024 20:27:36 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:
>> src/java.compiler/share/classes/javax/lang/model/element/ElementKind.java line 133:
>>
>>> 131: */
>>> 132: @PreviewFeature(feature=PreviewFeature.Feature.DERIVED_RECORD_CREATION, reflective=true)
>>> 133: COMPONENT_LOCAL_VARIABLE;
>>
>> I wonder if we can't just use: LOCAL_VARIABLE
>
> We could, and I was thinking of that. But, then I decided to go with a new kind, as I think it matches better the overall design of the Elements/Kinds. E.g. we have existing `EXCEPTION_PARAMETER` (used in `catch`) or `BINDING_VARIABLE`, rather than using `LOCAL_VARIABLE` for them.
>
> (Also, many of these variable kinds have some small, but significant differences in semantics from `LOCAL_VARIABLE` - e.g. some are never blank/are always definitely assigned.)
Given the JLS defines "component local variable" I think it makes sense to have a separate kind
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18509#discussion_r1553580520
More information about the core-libs-dev
mailing list