RFR: 8340145: Problem with generic pattern matching results in internal compiler error [v2]

Jan Lahoda jlahoda at openjdk.org
Wed Nov 20 10:10:29 UTC 2024


On Mon, 18 Nov 2024 14:09:37 GMT, Aggelos Biboudis <abimpoudis at openjdk.org> wrote:

>> In the following code, when calculating recursively the covered binding patterns, the nested case assumed that the direct supertype of `T2` will always be represented by a `ClassSymbol`. This PR intervenes the erasure calculation.
>> 
>> 
>> static <T, T2 extends T> T unwrapOrElse(Option<T2> option, T defaultValue) {
>>   return switch (option) {
>>      case Option.Some(T2 value) -> value;
>>      case Option.None<T2> _ -> defaultValue;
>>   };
>> }
>
> Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add test with multiple bounds

Looks good to me. Thanks!

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

Marked as reviewed by jlahoda (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/21606#pullrequestreview-2448147344


More information about the compiler-dev mailing list