1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
import java.util.function.Function;
import org.checkerframework.checker.nullness.qual.Nullable;
public class Issue1847B {
public void test1() {
// :: error: (dereference.of.nullable)
Function<@Nullable String, String> f1 = (@Nullable String myVar) -> myVar.toString();
{
String myVar = "hello";
}
// :: error: (dereference.of.nullable)
Function<@Nullable String, String> f2 = (@Nullable String myVar) -> myVar.toString();
}
public void test2() {
// :: error: (dereference.of.nullable)
Function<String, String> f1 = (@Nullable String myVar) -> myVar.toString();
}
}
|