Skip to content

Instantly share code, notes, and snippets.

@ruimo
Created October 18, 2019 02:30
Show Gist options
  • Save ruimo/4bceebdc0e2b09ebf825f4a2de403116 to your computer and use it in GitHub Desktop.
Save ruimo/4bceebdc0e2b09ebf825f4a2de403116 to your computer and use it in GitHub Desktop.
abstract class Iterator<E extends Exception> {
abstract boolean hasNext() throws E;
}
class DumbIterator extends Iterator<RuntimeException> {
boolean hasNext() throws RuntimeException {
return true;
}
}
public class Test {
void foo(Iterator<RuntimeException> b) {
b.hasNext();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment