Created
September 20, 2016 07:20
-
-
Save ashigeru/c7a638898b6712ff836b75460c6db1cc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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