I don't know exactly what is required to produce the problem, but I can see it with the following code (minimized from the original error in ImmutableMap):
$ cat MyList.java
import org.checkerframework.checker.nullness.qual.NonNull;
abstract class MyList<E extends @NonNull Object> {
static class Nested {
Nested(MyList<?> list) {
for (Object o : list.asIterable()) {}
}
}
abstract Iterable<E> asIterable();
}
$ checker/bin/javac -d out -processor org.checkerframework.checker.nullness.NullnessChecker MyList.java
MyList.java:5: error: [type.argument.type.incompatible] incompatible types in type argument.
Nested(MyList<?> list) {
^
found : ? extends @Initialized @Nullable Object
required: @Initialized @NonNull Object
1 error
I would expect for MyList<?> to be a valid parameterization (one with behavior equivalent to MyList<? extends @NonNull Object>).
The error goes away if I merely call asIterable (or even assign it to a variable of type Iterable<?>).
Source file and -version -verbose -AprintAllQualifiers output attached.