mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-20 03:20:56 +07:00
those lambda return expressions can't influence containing call inference according to lambda constraint; which means that no additional inference variables could be propagated during inference process hence exception constraints could operate with proper types which are in fact type parameters - which would lead to unhandled exceptions on the top level (IDEA-187930)
56 lines
1.1 KiB
Java
56 lines
1.1 KiB
Java
|
|
import java.io.IOException;
|
|
|
|
class Test {
|
|
|
|
interface ThrowableRunnable<T extends Throwable> {
|
|
void run() throws T;
|
|
}
|
|
|
|
interface ThrowableComputable<R, E extends Throwable> {
|
|
R compute() throws E;
|
|
}
|
|
|
|
private <D extends Throwable> void doTest(ThrowableRunnable<D> action) { }
|
|
|
|
|
|
public void testNoNotificationForWorkspace() {
|
|
doTest(() -> computeAndWait(() -> foo()));
|
|
}
|
|
|
|
private String foo() throws IOException {
|
|
return null;
|
|
}
|
|
|
|
|
|
public static <R, E extends Throwable> R computeAndWait(ThrowableComputable<R, E> action) throws E {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
class TestWithImplicitLambda {
|
|
|
|
interface ThrowableRunnable<T extends Throwable> {
|
|
void run(int k) throws T;
|
|
}
|
|
|
|
interface ThrowableComputable<R, E extends Throwable> {
|
|
R compute() throws E;
|
|
}
|
|
|
|
private <D extends Throwable> void doTest(ThrowableRunnable<D> action) { }
|
|
|
|
|
|
public void testNoNotificationForWorkspace() {
|
|
doTest((k) -> computeAndWait(() -> foo()));
|
|
}
|
|
|
|
private String foo() throws IOException {
|
|
return null;
|
|
}
|
|
|
|
|
|
public static <R, E extends Throwable> R computeAndWait(ThrowableComputable<R, E> action) throws E {
|
|
return null;
|
|
}
|
|
} |