mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-10 13:17:09 +07:00
lambda constraints: proceed with return expressions (IDEA-175426)
lambda with formal types won't lead to additional constraint after return type constraint processing, thus it need to be processed additionally
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Optional;
|
||||
|
||||
class GenericClass {
|
||||
<E extends Throwable> void build(Test<E, Optional<Integer>> test) { }
|
||||
|
||||
{
|
||||
build((IOException ex) -> returnOptional());
|
||||
}
|
||||
|
||||
private static <T> Optional<T> returnOptional() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
interface Test<E, T> {
|
||||
T evaluate(E ex);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user