checker/tests/nullness/java8inference/SimpleLambda.java
raw| 1 | // @skip-test until Issue 979 is fixed. |
| 2 | |
| 3 | import java.util.function.Supplier; |
| 4 | import org.checkerframework.checker.nullness.qual.NonNull; |
| 5 | import org.checkerframework.checker.nullness.qual.Nullable; |
| 6 | |
| 7 | public class SimpleLambda { |
| 8 | <T> T perform(Supplier<T> p) { |
| 9 | return p.get(); |
| 10 | } |
| 11 | |
| 12 | void test() { |
| 13 | @Nullable String s1 = perform(() -> (String) null); |
| 14 | @Nullable String s2 = this.<@Nullable String>perform(() -> (String) null); |
| 15 | @NonNull String s3 = perform(() -> ""); |
| 16 | } |
| 17 | } |