Skip to content

Instantly share code, notes, and snippets.

@ashigeru
Created September 20, 2016 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashigeru/c7a638898b6712ff836b75460c6db1cc to your computer and use it in GitHub Desktop.
Save ashigeru/c7a638898b6712ff836b75460c6db1cc to your computer and use it in GitHub Desktop.
public class InferExc {
public static void main(String[] args) /*never throw*/ {
caller(() -> { return; });
}
private static <T extends Throwable> void caller(Capture<T> c) throws T {
c.f();
}
@FunctionalInterface
public interface Capture<T extends Throwable> {
void f() throws T;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment