RFR: 8258662: JDK 17ea: Crash compiling instanceof check involving sealed interface

Jonathan Gibbons jjg at openjdk.java.net
Sun Dec 20 02:48:56 UTC 2020

On Sat, 19 Dec 2020 13:49:43 GMT, Guoxiong Li <github.com+13688759+lgxbslgx at openjdk.org> wrote:

> Hi all,
> The method `Types.isCastable` uses method `Types.areDisjoint` to do some check. But `Types.isCastable` doesn't check the type of the parameter before invoking method `Types.areDisjoint`. This patch adds the corresponding check and add a test case.
> Thank you for taking the time to review.
> Best Regards.

In general, the coding style in javac is to use methods and/or the kind to determine whether is symbol is the symbol for a class or not.

I'll leave it to others to recommend the current best practice for a change like this.


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

More information about the compiler-dev mailing list