java redundant cast: no semantic serialization when expected type is also serializable (IDEA-249705)

GitOrigin-RevId: 7ffe4dc7ef44099630afe65d7fb545337d982f7b
This commit is contained in:
Anna Kozlova
2020-09-21 20:35:20 +00:00
committed by intellij-monorepo-bot
parent cdbae12245
commit 0faebe5de7
2 changed files with 10 additions and 3 deletions
@@ -8,7 +8,15 @@ class Test {
r = (Runnable & Serializable)() -> {};
r = (Runnable & I)() -> {};
System.out.println(r);
J j = (<warning descr="Casting '() -> {...}' to 'J' is redundant">J</warning>) () -> {};
J j1 = (J1) () -> {};
}
interface I {}
interface J extends Serializable {
void m();
}
interface J1 extends J {}
}