Debian Codegraph @

framework/tests/all-systems/Issue953b.java

raw
1 // Test case for issue 953
2 // https://github.com/typetools/checker-framework/issues/953
3 // The signture of MyStream#collect is slightly different than the one in Issue953.java
4
5 import java.util.List;
6
7 public class Issue953b {
8 class MyCollector<A, B, C> {}
9
10 class MyStream<E> {
11 <F, G> F collect(MyCollector<? extends E, G, F> param) {
12 throw new RuntimeException();
13 }
14 }
15
16 public static void test(MyStream<Integer> y) {
17 // Type argument inference fails, so a checker may report a type checking error.
18 @SuppressWarnings("")
19 List<Integer> counts = y.collect(toList());
20 }
21
22 static <H> MyCollector<H, ?, List<H>> toList() {
23 throw new RuntimeException();
24 }
25 }