exception inference: don't check non-applicable methods (IDEA-178762)

This commit is contained in:
Anna Kozlova
2017-09-12 21:05:35 +03:00
parent 93b1084c31
commit b0ccbdebcf
3 changed files with 23 additions and 2 deletions
@@ -0,0 +1,18 @@
import java.io.IOException;
@FunctionalInterface
interface ThrowableRunnable<E extends Exception> {
void get() throws E;
static <E extends Exception> void m(ThrowableRunnable<E> supplier, Object... params) throws E {}
default void getContent() {
try {
m(() -> { throw new IOException(); });
} catch (IOException e) { }
}
}