Integrated: 8254286: Wrong inference in switch expression with "null" arm

Jan Lahoda jlahoda at openjdk.java.net
Fri Oct 23 09:52:38 UTC 2020


On Fri, 9 Oct 2020 17:08:36 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

> Basically, for code like:
> 
>         var t1 = switch (s) {
>             case 1 -> i1;
>             case 2 -> null;
>             default -> i2;
>         };
> 
> Attr.condType is currently passing <type-of-i1>, BOT, <type-of-i2> to Types.lub. But Types.lub needs the list without BOT, so filtering BOT(s) out of the list.

This pull request has now been integrated.

Changeset: 0e920531
Author:    Jan Lahoda <jlahoda at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/0e920531
Stats:     58 lines in 3 files changed: 55 ins; 0 del; 3 mod

8254286: Wrong inference in switch expression with "null" arm

Reviewed-by: mcimadamore, vromero

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

PR: https://git.openjdk.java.net/jdk/pull/583


More information about the compiler-dev mailing list