import java.util.List;
import java.util.function.Supplier;
class RawLambda {
static <T> List<T> never() {
throw new Error();
}
void m() {
Supplier s = () -> never();
}
}
javac -processor nullness RawLambda.java (plain javac accepts it):
RawLambda.java:10: error: [type.argument.inference.crashed] Type argument inference crashed for RawLambda.never
Supplier s = () -> never();
^
error: An exception occurred: False bound for: Constraint: inference type: java.util.List<T> <: /*INFERENCE FAILED for:*/ ? extends Object Result: FALSE
With -AconvertTypeArgInferenceCrashToWarning=false, the exception is thrown from:
FalseBoundException: False bound for: Constraint: inference type: java.util.List<T> <: /*INFERENCE FAILED for:*/ ? extends Object Result: FALSE
at ...typeinference8.constraint.ConstraintSet.reduceOneStep(ConstraintSet.java:458)
at ...typeinference8.constraint.ConstraintSet.reduce(ConstraintSet.java:391)
at ...typeinference8.InvocationTypeInference.createB3(InvocationTypeInference.java:443)
at ...typeinference8.InvocationTypeInference.infer(InvocationTypeInference.java:170)
at ...typeinference8.DefaultTypeArgumentInference.inferTypeArgs(DefaultTypeArgumentInference.java:108)
Supplier<?>, Supplier<Object>, and Supplier<? extends Object> do not crash; a field initializer, a cast (Supplier) () -> never(), and a block lambda body do. Also reproduces with the Interning and Tainting Checkers.
Found in reactor-core: Queues.java:481-492 (static final Supplier ZERO_SUPPLIER = () -> Hooks.wrapQueue(new ZeroQueue<>());) and MonoTimeout.java:47 (final static Function NEVER = e -> Flux.never();), 7 sites in total. Possibly related: #2086 (fixed), but this still crashes on master.
javac -processor nullness RawLambda.java(plain javac accepts it):With
-AconvertTypeArgInferenceCrashToWarning=false, the exception is thrown from:Supplier<?>,Supplier<Object>, andSupplier<? extends Object>do not crash; a field initializer, a cast(Supplier) () -> never(), and a block lambda body do. Also reproduces with the Interning and Tainting Checkers.Found in reactor-core:
Queues.java:481-492(static final Supplier ZERO_SUPPLIER = () -> Hooks.wrapQueue(new ZeroQueue<>());) andMonoTimeout.java:47(final static Function NEVER = e -> Flux.never();), 7 sites in total. Possibly related: #2086 (fixed), but this still crashes on master.