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 15:44:13 +02:00
parent 3fb6d0d61a
commit 9e0394a757
4 changed files with 24 additions and 4 deletions

View File

@@ -15,8 +15,8 @@ class NoInferenceResult {
<T> void m1(T t) { }
void test() {
m((String s1) -> <error descr="Target type of a lambda conversion must be an interface">(String s2) -> s1 + s2</error>);
m((String s1) -> {return <error descr="Target type of a lambda conversion must be an interface">(String s2) -> s1 + s2</error>;});
m(<error descr="Object is not a functional interface">(String s1) -> (String s2) -> s1 + s2</error>);
m(<error descr="Object is not a functional interface">(String s1) -> {return (String s2) -> s1 + s2;}</error>);
m((String s1) -> s1.length());
m((String s1) -> s1);