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