| 1 |
// Test case for issue #572: https://github.com/typetools/checker-framework/issues/572 |
| 2 |
|
| 3 |
import java.util.function.BiFunction; |
| 4 |
import org.checkerframework.checker.nullness.qual.NonNull; |
| 5 |
import org.checkerframework.checker.nullness.qual.Nullable; |
| 6 |
|
| 7 |
class ParenthesizedLambda { |
| 8 |
static <A, B, C> C biApply(BiFunction<A, B, C> f, A a, B b) { |
| 9 |
return f.apply(a, b); |
| 10 |
} |
| 11 |
|
| 12 |
public <A, B> A konst(@NonNull A a, @Nullable B b) { |
| 13 |
// :: error: (argument.type.incompatible) |
| 14 |
return biApply(((first, second) -> first), a, b); |
| 15 |
} |
| 16 |
} |