import java.util.List;
import java.util.Optional;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collector;
public class CrashRepro {
static class Foo {}
interface Promise<T> {
<U> Promise<U> then(Function<? super T, ? extends U> function);
}
static <O, C> Promise<C> make(
Supplier<Promise<O>> function, Collector<? super O, ?, C> collector) {
throw new UnsupportedOperationException();
}
static <E> Collector<E, ?, List<E>> toImmutableList() {
throw new UnsupportedOperationException();
}
Promise<?> run(Promise<Optional<Foo>> promise) {
return make(
() ->
promise.then(
o -> {
if (o != null) {
return o;
}
return Optional.empty();
}),
toImmutableList());
}
}
$ ~/checker-framework-4.0.0/checker/bin/javac -processor nullness CrashRepro.java
CrashRepro.java:24: error: [type.argument.inference.crashed] Type argument inference crashed for CrashRepro.make
return make(
^
error: An exception occurred: AsSuperVisitor: type is not an erased subtype of supertype.
type: Object
superType: Foo
CrashRepro.java:24: error: [type.argument.inference.crashed] Type argument inference crashed for CrashRepro.make
return make(
^
error: An exception occurred: AsSuperVisitor: type is not an erased subtype of supertype.
type: @Initialized @Nullable Object
superType: @Initialized @NonNull Foo
2 errors