blob: 3fa235fd7297b04f2d0e76fe7fc13e66525fe198 [file] [log] [blame]
// Test case for Issue 1920:
// https://github.com/typetools/checker-framework/issues/1920
import java.util.Iterator;
import java.util.NoSuchElementException;
@SuppressWarnings("all") // Only check for crashes
public class Issue1920 {
static class Foo implements Iterable {
public Iterator iterator() {
return new Iterator() {
@Override
public boolean hasNext() {
return false;
}
@Override
public Object next() {
throw new NoSuchElementException();
}
};
}
}
static void testErasedIterator(Foo foo) {
for (Object x : foo) {
x.hashCode();
}
}
}