blob: 8a6dc26b744e7cfa8021c169b9f6bdbc3b845d85 [file] [log] [blame]
// Test case for Issue 1727:
// https://github.com/typetools/checker-framework/issues/1727
import org.checkerframework.checker.nullness.qual.Nullable;
class B {}
public class Issue1727 {
private B foo() {
// Default type for local variable b is @UnknownInitialization @Nullable
B b;
while (true) {
B op = getB();
if (op == null) {
b = new B();
break;
} else {
b = op;
break;
}
}
return b;
}
private @Nullable B getB() {
return new B();
}
}