| 1 |
// Test case for Issue 282 (minimized) |
| 2 |
// https://github.com/typetools/checker-framework/issues/282 |
| 3 |
|
| 4 |
import java.util.Collection; |
| 5 |
import java.util.Comparator; |
| 6 |
import java.util.Set; |
| 7 |
import org.checkerframework.checker.nullness.qual.*; |
| 8 |
|
| 9 |
class Issue282Min { |
| 10 |
static <M> Set<M> copyOf(Comparator<? super M> comparator, Collection<? extends M> elements) { |
| 11 |
// :: error: (return.type.incompatible) |
| 12 |
return null; |
| 13 |
} |
| 14 |
} |
| 15 |
|
| 16 |
class Example282Min { |
| 17 |
<T extends @NonNull Object> Set<T> foo(Comparator<Object> ord, Collection<T> set) { |
| 18 |
return Issue282Min.copyOf(ord, set); |
| 19 |
} |
| 20 |
} |