anonym -> lambda: disable in case when inferred type differs from type of anonymous class and parameter of param type is used inside (IDEA-127603);

BTW param.toString would be also rejected
This commit is contained in:
Anna Kozlova
2014-07-21 17:56:21 +02:00
parent 89dc528242
commit a46f4cef52
3 changed files with 35 additions and 18 deletions
@@ -0,0 +1,16 @@
// "Replace with lambda" "false"
import java.util.function.Function;
class Test {
void ab() {
comparing(new Func<caret>tion<Integer, String>() {
public String apply(Integer pObj) {
return Integer.toString(pObj);
}
});
}
static <T> void comparing(Function<T, String> keyExtractor){}
}