[code-reflection] RFR: Update the model of pattern matching when pattern variable identifier is underscore [v6]

Mourad Abbay mabbay at openjdk.org
Sun Sep 15 04:25:17 UTC 2024


On Thu, 12 Sep 2024 16:18:00 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

>> Mourad Abbay has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update the result type of TypePatternOp
>
> src/java.base/share/classes/java/lang/reflect/code/op/CoreOp.java line 2171:
> 
>> 2169:             super(NAME, List.of(init));
>> 2170: 
>> 2171:             this.varName = varName == null || varName.isEmpty() ? null : varName;
> 
> Was there is a reason why you check for an empty string?

The compiler code may pass an empty string for the name of the Var, e.g. unnamed pattern variable.

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

PR Review Comment: https://git.openjdk.org/babylon/pull/227#discussion_r1759961222


More information about the babylon-dev mailing list