| 1 |
// Test case for Issue #2088: |
| 2 |
// https://github.com/typetools/checker-framework/issues/2088 |
| 3 |
|
| 4 |
import java.lang.reflect.ParameterizedType; |
| 5 |
import java.lang.reflect.Type; |
| 6 |
|
| 7 |
@SuppressWarnings({"unchecked", ""}) // Check for crashes only |
| 8 |
abstract class Issue2088 { |
| 9 |
|
| 10 |
interface A<K extends Comparable<K>> {} |
| 11 |
|
| 12 |
interface B extends A<Long> {} |
| 13 |
|
| 14 |
interface C<P extends B, E extends B> { |
| 15 |
interface F<T extends C<?, ?>> {} |
| 16 |
} |
| 17 |
|
| 18 |
interface D {} |
| 19 |
|
| 20 |
static class Key<T> { |
| 21 |
static Key<?> get(Type type) { |
| 22 |
return null; |
| 23 |
} |
| 24 |
} |
| 25 |
|
| 26 |
abstract ParameterizedType n(Type o, Class<?> r, Type... a); |
| 27 |
|
| 28 |
<X extends B, Y extends C<?, X>, Z extends Y> void f(Class<Y> c) { |
| 29 |
Key<C.F<Z>> f = (Key<C.F<Z>>) Key.get(n(C.class, C.F.class, c)); |
| 30 |
} |
| 31 |
} |