blob: 6e0ad7ea9df23d53a07c1fcee5d9a9698cf13a55 [file] [log] [blame]
// Test case for issue #1000:
// https://github.com/typetools/checker-framework/issues/1000
import java.util.Optional;
import org.checkerframework.checker.nullness.qual.Nullable;
public class Issue1000 {
void illegalInstantiation(Optional<@Nullable String> arg) {}
String orElseAppliedToNonNull(Optional<String> opt) {
return opt.orElse("");
}
String orElseAppliedToNullable(Optional<String> opt) {
// :: error: (return)
return opt.orElse(null);
}
}