From d5107d652fe5a758a834cd70ec782365a32729bb Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Tue, 22 Apr 2014 13:26:20 +0200 Subject: [PATCH] testdata: ensure intersection type is not missed during inference --- .../newLambda/LiftedIntersectionType.java | 22 +++++++++++++++++++ .../lambda/NewLambdaHighlightingTest.java | 4 ++++ 2 files changed, 26 insertions(+) create mode 100644 java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/LiftedIntersectionType.java diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/LiftedIntersectionType.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/LiftedIntersectionType.java new file mode 100644 index 000000000000..de9d517da449 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/LiftedIntersectionType.java @@ -0,0 +1,22 @@ +class Test { + + interface A { + A f(); + } + interface B {} + + static abstract class C implements A, B {} + static abstract class D implements A, B {} + + interface I { + T m(T arg); + } + + void bar(C c) { + foo(c, x -> x.f()); + foo(c, x -> x); + } + + void foo(T t1, I t3) {} + +} diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewLambdaHighlightingTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewLambdaHighlightingTest.java index 3f4d1802e588..f5f286a17e31 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewLambdaHighlightingTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewLambdaHighlightingTest.java @@ -202,6 +202,10 @@ public class NewLambdaHighlightingTest extends LightDaemonAnalyzerTestCase { doTest(); } + public void testLiftedIntersectionType() throws Exception { + doTest(); + } + private void doTest() { doTest(false); }