java redundant cast: allow warnings in poly conditional when target type remains the same

GitOrigin-RevId: f953fc42882a1eaad0b0a8c65d1e94236f0ec99e
This commit is contained in:
Anna Kozlova
2020-05-05 11:29:06 +00:00
committed by intellij-monorepo-bot
parent b4993721fb
commit 349c96eaee
2 changed files with 7 additions and 5 deletions
@@ -5,6 +5,7 @@ class Test {
Object o = true ? ((Supplier<String>) () -> "") : null;
Supplier<String> s1 = true ? ((<warning descr="Casting '() -> {...}' to 'Supplier<String>' is redundant">Supplier<String></warning>) () -> "") : null;
Supplier<String> s2 = true ? ((A) () -> "") : null;
A s3 = true ? ((<warning descr="Casting '() -> {...}' to 'A' is redundant">A</warning>) () -> "") : null;
}
interface A extends Supplier<String> {}