Integrated: 8268885: duplicate checkcast when destination type is not first type of intersection type

Vicente Romero vromero at openjdk.java.net
Thu Sep 9 18:40:10 UTC 2021


On Mon, 23 Aug 2021 23:29:15 GMT, Vicente Romero <vromero at openjdk.org> wrote:

> Please review this PR which is fixing the following bug: javac is generating duplicate checkcast for cases like:
> 
> 
> class IntersectionTypeTest {
>     interface I1 {}
>     interface I2 {}
>     static class C {}
>     void test() {
>         I2 i = (I1 & I2) new C();
>     }
> }
> 
> basically when an intersection type is used in a cast expression and the target is not the type in the intersection.
> 
> TIA
> 
> PS. I also ran the JCK tests for this patch, same results as without the patch

This pull request has now been integrated.

Changeset: dd1209e4
Author:    Vicente Romero <vromero at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/dd1209e4ae3c8e42d121329639ec4bd359d0a456
Stats:     37 lines in 2 files changed: 24 ins; 3 del; 10 mod

8268885: duplicate checkcast when destination type is not first type of intersection type

Reviewed-by: jlahoda

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

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


More information about the compiler-dev mailing list