Minimal Reproducer
SmallRepro.java:
import java.util.ArrayList;
import java.util.List;
class SmallRepro<ID, T> {
static class Box<ID, T> {}
static class Worker<ID, T> {
List<Box<ID, T>> f(List<Box<ID, T>> xs) {
return xs == null ? new ArrayList<>() : xs;
}
}
}
Command
./gradlew dist --console=plain --quiet
./scripts/inference --hacks=true --mode INFER \
--checker nninf.NninfChecker \
--solver checkers.inference.solver.MaxSat2TypeSolver \
SmallRepro.java
Error
Error in AnnotatedTypeMirror.fromExpression(InferenceAnnotatedTypeFactory, condExpr#num0):
Cannot invoke "com.sun.source.util.TreePath.getParentPath()"
because the return value of
"checkers.inference.VariableAnnotator.expensiveBackupGetPath(...)" is null
Expected
Inference should not crash on this valid Java program. If CFI cannot recover a TreePath, it should use a fallback location or report a controlled diagnostic.
Minimal Reproducer
SmallRepro.java:Command
Error
Expected
Inference should not crash on this valid Java program. If CFI cannot recover a
TreePath, it should use a fallback location or report a controlled diagnostic.