erasure of method call expression type if method is not generics but unchecked conversion was needed to check the applicability (IDEA-157223)

This commit is contained in:
Anna Kozlova
2016-06-14 11:34:32 +03:00
parent 2080ba6291
commit 79edaf45af
4 changed files with 34 additions and 6 deletions
@@ -0,0 +1,19 @@
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
class Test {
public static <Om> List<Om> sort(Comparator comp, Stream<Om> stream) {
<error descr="Incompatible types. Found: 'java.lang.Object', required: 'java.util.List<Om>'">return stream.sorted(comp).collect(Collectors.toList());</error>
}
//accept unbounded wildcards
List<String> get(List<?> lists) {
return null;
}
void foo(List l) {
String p = get(l).get(0);
}
}