| 1 |
// Test case for Issue 1424. |
| 2 |
// https://github.com/typetools/checker-framework/issues/1424 |
| 3 |
|
| 4 |
@SuppressWarnings("unchecked") |
| 5 |
abstract class Issue1424 { |
| 6 |
class Box<T> {} |
| 7 |
|
| 8 |
interface Callable<V> { |
| 9 |
V call() throws Exception; |
| 10 |
} |
| 11 |
|
| 12 |
class MyCallable<T> implements Callable<T> { |
| 13 |
MyCallable(Callable<T> delegate) {} |
| 14 |
|
| 15 |
public T call() throws Exception { |
| 16 |
throw new RuntimeException(); |
| 17 |
} |
| 18 |
} |
| 19 |
|
| 20 |
abstract <T> Box<T> submit(Callable<T> t); |
| 21 |
|
| 22 |
Box<Boolean> foo() { |
| 23 |
return submit(new MyCallable(() -> true)); |
| 24 |
} |
| 25 |
} |