java: redundant cast: check inference problems in cast operand

expected type (available after removing type cast) may add bounds for inference variables which would lead to errors after applying the fix

GitOrigin-RevId: 24a97411b7175cacabd8e81ed5711509195dfd4d
This commit is contained in:
Anna Kozlova
2020-05-15 20:27:18 +00:00
committed by intellij-monorepo-bot
parent 8d3b5500f9
commit 4b5272c14a
5 changed files with 36 additions and 11 deletions
@@ -3,7 +3,7 @@ import java.util.stream.Collectors;
class Test {
private static List<Object> test(List<List> list) {
return list.stream().flatMap(List::stream).collect(Collectors.toList());
<error descr="Incompatible types. Found: 'java.lang.Object', required: 'java.util.List<java.lang.Object>'">return list.stream().flatMap(List::stream).collect(Collectors.toList());</error>
}
private static List<Object> test1(List<List> list) {