diff --git a/compiler/fir/resolve/testData/resolve/stdlib/problems/unresolvedComparator.kt b/compiler/fir/resolve/testData/resolve/stdlib/problems/unresolvedComparator.kt new file mode 100644 index 00000000000..d1760f718e1 --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/stdlib/problems/unresolvedComparator.kt @@ -0,0 +1,15 @@ +fun test_1() { + val comp = Comparator { x, y -> 1 } +} + +fun test_2(list: List) { + val comp = java.util.Comparator { x, y -> 1 } +} + +fun test_3(comparator: java.util.Comparator) { + comparator.compare(1, 2) +} + +fun test_4(comparator: Comparator) { + comparator.compare(1, 2) +} \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/stdlib/problems/unresolvedComparator.txt b/compiler/fir/resolve/testData/resolve/stdlib/problems/unresolvedComparator.txt new file mode 100644 index 00000000000..c8f3395249e --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/stdlib/problems/unresolvedComparator.txt @@ -0,0 +1,19 @@ +FILE: unresolvedComparator.kt + public final fun test_1(): R|kotlin/Unit| { + lval comp: = #( = Comparator@fun (x: R|class error: No type for parameter|, y: R|class error: No type for parameter|): R|kotlin/Int| { + Int(1) + } + ) + } + public final fun test_2(list: R|kotlin/collections/List|): R|kotlin/Unit| { + lval comp: = Q|java/util|.#( = Comparator@fun (x: R|class error: No type for parameter|, y: R|class error: No type for parameter|): R|kotlin/Int| { + Int(1) + } + ) + } + public final fun test_3(comparator: R|java/util/Comparator|): R|kotlin/Unit| { + R|/comparator|.R|FakeOverride|(Int(1), Int(2)) + } + public final fun test_4(comparator: R|kotlin/Comparator|): R|kotlin/Unit| { + R|/comparator|.R|FakeOverride|(Int(1), Int(2)) + } diff --git a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithStdlibTestGenerated.java b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithStdlibTestGenerated.java index 2dba4d49baa..2019c115d62 100644 --- a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithStdlibTestGenerated.java +++ b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithStdlibTestGenerated.java @@ -481,4 +481,22 @@ public class FirDiagnosticsWithStdlibTestGenerated extends AbstractFirDiagnostic runTest("compiler/fir/resolve/testData/resolve/stdlib/j+k/StaticGenericMethod.kt"); } } + + @TestMetadata("compiler/fir/resolve/testData/resolve/stdlib/problems") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Problems extends AbstractFirDiagnosticsWithStdlibTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInProblems() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/fir/resolve/testData/resolve/stdlib/problems"), Pattern.compile("^([^.]+)\\.kt$"), true); + } + + @TestMetadata("unresolvedComparator.kt") + public void testUnresolvedComparator() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/stdlib/problems/unresolvedComparator.kt"); + } + } }