java functional expressions: fix for rendering in case of {ellipsis, primitive, array} type

This commit is contained in:
Dmitry Batkovich
2016-11-18 15:11:48 +03:00
parent fed7a4c3cd
commit f5e1fb4de0
2 changed files with 37 additions and 1 deletions
@@ -67,6 +67,30 @@ public class JavaFunctionalExpressionPresentationTest extends CodeInsightTestCas
}
public void testLambdaEllipsisParameter() {
doTest("import java.util.*;" +
"import java.util.function.Function;" +
"class A { Function<?, ?> f = " +
"(String... s) -> s;}",
"(String... s) -> {...}");
}
public void testLambdaArrayParameter() {
doTest("import java.util.*;" +
"import java.util.function.Function;" +
"class A { Function<?, ?> f = " +
"(String[] is) -> null;}",
"(String[] is) -> {...}");
}
public void testLambdaWithPrimitiveParameter() {
doTest("import java.util.*;" +
"import java.util.function.Function;" +
"class A { Function<?, ?> f = " +
"(int[] i) -> null;}",
"(int[] i) -> {...}");
}
public void testMethodReferencePresentation() {
doTest("import java.util.Supplier; " +
"class A { Supplier<String> s = java.util.Collections.<String>emptyEnumeration()::toString; }",