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

Jan Lahoda jlahoda at openjdk.java.net
Fri Oct 1 08:56:35 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)`.

This pull request has now been integrated.

Changeset: 18870284
Author:    Jan Lahoda <jlahoda at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/18870284084aaaf729640de0105ce21e253546b9
Stats:     45 lines in 4 files changed: 40 ins; 2 del; 3 mod

8269113: Javac throws when compiling switch (null)

Co-authored-by: Guoxiong Li <gli at openjdk.org>
Reviewed-by: vromero

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

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


More information about the compiler-dev mailing list