lambda highlighting: if return statement has problem, try to highlight only corresponding return even if containing inference failed

This commit is contained in:
Anna.Kozlova
2016-10-07 13:55:01 +02:00
parent c0de6f3d36
commit b560ee5910
5 changed files with 68 additions and 69 deletions
@@ -33,7 +33,7 @@ class TypeArgsConsistency1 {
I<Integer> i1 = (i, j) -> i + j;
foo((i, j) -> i + j);
I<Integer> i2 =bar((i, j) -> i) ;
I<Integer> i3 = bar(<error descr="Bad return type in lambda expression: String cannot be converted to int">(i, j) -> "" + i + j</error>);
I<Integer> i3 = bar((i, j) -> <error descr="Bad return type in lambda expression: String cannot be converted to int">"" + i + j</error>);
}
}
@@ -66,9 +66,9 @@ class Test2 {
{
bar(x -> x);
bar1(x -> x);
bar2(1, <error descr="Bad return type in lambda expression: List<Integer> cannot be converted to Integer">x -> x</error>);
bar2("", <error descr="Bad return type in lambda expression: List<String> cannot be converted to String">x -> x</error>);
bar3(<error descr="Bad return type in lambda expression: List<String> cannot be converted to String">x -> x</error>, "");
bar2(1, x -> <error descr="Bad return type in lambda expression: List<Integer> cannot be converted to Integer">x</error>);
bar2("", x -> <error descr="Bad return type in lambda expression: List<String> cannot be converted to String">x</error>);
bar3(x -> <error descr="Bad return type in lambda expression: List<String> cannot be converted to String">x</error>, "");
}
}