Closed GoogleCodeExporter closed 9 years ago
I get this error message in 1.7.5, I didn't get it previously in 1.7.2.
Original comment by trask.st...@gmail.com
on 31 Mar 2014 at 6:28
I'm not sure if this is related, but I also ran into this:
Test.java:7: error: [type.argument.type.incompatible] incompatible types in type argument.
for (Map.Entry<? extends String, /*@Nullable*/Object> entry : map.entrySet()) {
^
found : @Initialized @Nullable Object
required: @Initialized @NonNull Object
1 error
Using Test.java:
import java.util.Map;
import java.util.HashMap;
import checkers.nullness.quals.Nullable;
class Test {
void test() {
Map<String, /*@Nullable*/Object> map = new HashMap<>();
for (Map.Entry<? extends String, /*@Nullable*/Object> entry : map.entrySet()) {
}
}
}
Changing "/*@Nullable*/Object" to "? extends /*@Nullable*/Object" makes the
error go away. I didn't get this in 1.7.2 either.
Original comment by trask.st...@gmail.com
on 31 Mar 2014 at 6:56
Original comment by michael.ernst@gmail.com
on 15 Apr 2014 at 6:46
Hi Trask,
sorry, I can't reproduce any of these issues.
I've added a test case:
checker-framework/checker/tests/nullness/generics/MapLoop.java
which I'll push later today, containing these examples.
Please re-open the issue if I'm missing something.
cu, WMD.
Original comment by wdi...@gmail.com
on 10 May 2014 at 8:33
I upgraded to latest and I'm not seeing this anymore. Thanks.
Original comment by trask.st...@gmail.com
on 28 May 2014 at 5:21
Original issue reported on code.google.com by
trask.st...@gmail.com
on 31 Mar 2014 at 5:56