RFR: 8269113: Javac throws when compiling switch (null)

Vicente Romero vromero at openjdk.java.net
Tue Sep 28 15:36:32 UTC 2021

On Mon, 27 Sep 2021 11:15:03 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

> This handles a case of `switch (null)` (i.e. switch over a literal `null`). It is necessary to handle `BOT` (null type) in the switch's selector, similarly to how it is handled in `null instanceof ...`. Note that since any reference type is a supertype of the `null` (JLS 4.10.2.), any type pattern is total for `switch (null)`.

looks good to me


Marked as reviewed by vromero (Reviewer).

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

More information about the compiler-dev mailing list