mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
lambda: lambda on vararg place
This commit is contained in:
@@ -389,7 +389,7 @@ public class LambdaUtil {
|
||||
if (type == null) {
|
||||
type = getFunctionalInterfaceType(lambdaExpression, false);
|
||||
}
|
||||
final PsiClassType.ClassResolveResult resolveResult = type instanceof PsiClassType ? ((PsiClassType)type).resolveGenerics() : null;
|
||||
final PsiClassType.ClassResolveResult resolveResult = PsiUtil.resolveGenericsClassInType(type);
|
||||
if (resolveResult != null) {
|
||||
final PsiMethod method = getFunctionalInterfaceMethod(type);
|
||||
if (method != null) {
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
class Test <T, U> {
|
||||
protected U exerciseOps(TestData<T> data, TerminalOp<T, U> terminal, IntermediateOp<T, U>... ops) {
|
||||
return exerciseOps(data, terminal, (u, v) -> u.equals(v));
|
||||
}
|
||||
|
||||
|
||||
|
||||
class TestData<K> {}
|
||||
interface TerminalOp<L, M> extends IntermediateOp<L, M> {
|
||||
|
||||
}
|
||||
interface IntermediateOp<L1, M1> { boolean _(L1 l, M1 m);}
|
||||
|
||||
}
|
||||
+4
@@ -88,6 +88,10 @@ public class LambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testDefaultMethod() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testLambdaOnVarargPlace() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testNoInferenceResult() throws Exception {
|
||||
doTest();
|
||||
|
||||
Reference in New Issue
Block a user