Integrated: 8263590: Rawtypes warnings should be produced for pattern matching in instanceof

Jan Lahoda jlahoda at openjdk.java.net
Thu Mar 18 12:40:41 UTC 2021


On Mon, 15 Mar 2021 17:59:33 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

> For code like:
> Object o = null;
> boolean b = o instanceof List l;
> 
> There should be a raw-type warning for `List`, as we are effectively declaring a variable with a raw type.
> 
> Code like:
> Object o = null;
> boolean b = o instanceof List;
> 
> Will not produce a warning (as it doesn't so far), as the (raw) type is not used in a problematic context.

This pull request has now been integrated.

Changeset: 9cd21b68
Author:    Jan Lahoda <jlahoda at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/9cd21b68
Stats:     17 lines in 3 files changed: 16 ins; 0 del; 1 mod

8263590: Rawtypes warnings should be produced for pattern matching in instanceof

Reviewed-by: mcimadamore

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

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


More information about the compiler-dev mailing list