From 50aa918791d5c9475a6232471e757f64061c7996 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Tue, 9 Sep 2014 17:51:05 +0400 Subject: [PATCH] Failing test for type inference --- .../tests/platformTypes/samConstructor.kt | 17 +++++++++++++++++ .../checkers/JetDiagnosticsTestGenerated.java | 6 ++++++ 2 files changed, 23 insertions(+) create mode 100644 compiler/testData/diagnostics/tests/platformTypes/samConstructor.kt diff --git a/compiler/testData/diagnostics/tests/platformTypes/samConstructor.kt b/compiler/testData/diagnostics/tests/platformTypes/samConstructor.kt new file mode 100644 index 00000000000..51507e0d511 --- /dev/null +++ b/compiler/testData/diagnostics/tests/platformTypes/samConstructor.kt @@ -0,0 +1,17 @@ +// FILE: p/J.java + +package p; + +public class J { + public static void c(java.util.Comparator c) {} + +} + +// FILE: k.kt + +import java.util.* +import p.* + +fun test() { + J.c(Comparator { a, b -> b - a }) +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java index 8a93254647f..276ee08404d 100644 --- a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java @@ -7755,6 +7755,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { doTest(fileName); } + @TestMetadata("samConstructor.kt") + public void testSamConstructor() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/platformTypes/samConstructor.kt"); + doTest(fileName); + } + @TestMetadata("compiler/testData/diagnostics/tests/platformTypes/commonSupertype") @TestDataPath("$PROJECT_ROOT") @RunWith(org.jetbrains.jet.JUnit3RunnerWithInners.class)