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:
Anna.Kozlova
2017-07-05 16:48:52 +02:00
parent 3fb6d0d61a
commit 9e0394a757
4 changed files with 24 additions and 4 deletions
@@ -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);
}
}