mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 09:19:13 +07:00
lambda: check assignment for proper types (IDEA-137564)
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
abstract class Main {
|
||||
|
||||
public interface LifetimeFunction<ELF extends Throwable> {
|
||||
int execute() throws ELF;
|
||||
}
|
||||
|
||||
public final <E extends Throwable> void foo(final LifetimeFunction<E> action) throws E {
|
||||
runSync(() -> {
|
||||
action.execute();
|
||||
return 42;
|
||||
});
|
||||
}
|
||||
|
||||
abstract < E1 extends Throwable> void runSync(LifetimeFunction<E1> action) throws E1;
|
||||
}
|
||||
Reference in New Issue
Block a user