diff --git a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/AbstractFirOldFrontendDiagnosticsTestWithStdlib.kt b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/AbstractFirOldFrontendDiagnosticsTestWithStdlib.kt index 415fe08dbd9..aadf73a1738 100644 --- a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/AbstractFirOldFrontendDiagnosticsTestWithStdlib.kt +++ b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/AbstractFirOldFrontendDiagnosticsTestWithStdlib.kt @@ -9,6 +9,6 @@ import org.jetbrains.kotlin.test.ConfigurationKind abstract class AbstractFirOldFrontendDiagnosticsTestWithStdlib : AbstractFirOldFrontendDiagnosticsTest() { override fun getConfigurationKind(): ConfigurationKind { - return ConfigurationKind.ALL + return ConfigurationKind.NO_KOTLIN_REFLECT } } \ No newline at end of file diff --git a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestGenerated.java index 04627edf4e6..404218fba77 100644 --- a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestGenerated.java @@ -17273,24 +17273,6 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte } } - @TestMetadata("compiler/testData/diagnostics/tests/reflection") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Reflection extends AbstractFirOldFrontendDiagnosticsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInReflection() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/reflection"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); - } - - @TestMetadata("noReflectionInClassPath.kt") - public void testNoReflectionInClassPath() throws Exception { - runTest("compiler/testData/diagnostics/tests/reflection/noReflectionInClassPath.kt"); - } - } - @TestMetadata("compiler/testData/diagnostics/tests/regressions") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestWithStdlibGenerated.java b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestWithStdlibGenerated.java index 1c5f9823a08..96e1f1ac8df 100644 --- a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestWithStdlibGenerated.java +++ b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestWithStdlibGenerated.java @@ -2296,6 +2296,11 @@ public class FirOldFrontendDiagnosticsTestWithStdlibGenerated extends AbstractFi KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/reflection"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @TestMetadata("noReflectionInClassPath.kt") + public void testNoReflectionInClassPath() throws Exception { + runTest("compiler/testData/diagnostics/testsWithStdLib/reflection/noReflectionInClassPath.kt"); + } + @TestMetadata("typeOfWithNonReifiedParameter.kt") public void testTypeOfWithNonReifiedParameter() throws Exception { runTest("compiler/testData/diagnostics/testsWithStdLib/reflection/typeOfWithNonReifiedParameter.kt"); @@ -2359,11 +2364,6 @@ public class FirOldFrontendDiagnosticsTestWithStdlibGenerated extends AbstractFi runTest("compiler/testData/diagnostics/testsWithStdLib/regression/kt34391.kt"); } - @TestMetadata("kt9345.kt") - public void testKt9345() throws Exception { - runTest("compiler/testData/diagnostics/testsWithStdLib/regression/kt9345.kt"); - } - @TestMetadata("kt9820_javaFunctionTypeInheritor.kt") public void testKt9820_javaFunctionTypeInheritor() throws Exception { runTest("compiler/testData/diagnostics/testsWithStdLib/regression/kt9820_javaFunctionTypeInheritor.kt"); diff --git a/compiler/testData/codegen/box/regressions/kt9345.kt b/compiler/testData/codegen/box/regressions/kt9345.kt new file mode 100644 index 00000000000..6f04999cda1 --- /dev/null +++ b/compiler/testData/codegen/box/regressions/kt9345.kt @@ -0,0 +1,15 @@ +// IGNORE_BACKEND_FIR: JVM_IR +// TARGET_BACKEND: JVM +// WITH_REFLECT + +// KT-9345 Type inference failure +fun Class<*>.foo(): Any? = kotlin.objectInstance + + +object OK { + override fun toString(): String = "OK" +} + +fun box(): String { + return OK::class.java.foo().toString() +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/reflection/noReflectionInClassPath.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/reflection/noReflectionInClassPath.fir.kt similarity index 100% rename from compiler/testData/diagnostics/tests/reflection/noReflectionInClassPath.fir.kt rename to compiler/testData/diagnostics/testsWithStdLib/reflection/noReflectionInClassPath.fir.kt diff --git a/compiler/testData/diagnostics/tests/reflection/noReflectionInClassPath.kt b/compiler/testData/diagnostics/testsWithStdLib/reflection/noReflectionInClassPath.kt similarity index 100% rename from compiler/testData/diagnostics/tests/reflection/noReflectionInClassPath.kt rename to compiler/testData/diagnostics/testsWithStdLib/reflection/noReflectionInClassPath.kt diff --git a/compiler/testData/diagnostics/tests/reflection/noReflectionInClassPath.txt b/compiler/testData/diagnostics/testsWithStdLib/reflection/noReflectionInClassPath.txt similarity index 100% rename from compiler/testData/diagnostics/tests/reflection/noReflectionInClassPath.txt rename to compiler/testData/diagnostics/testsWithStdLib/reflection/noReflectionInClassPath.txt diff --git a/compiler/testData/diagnostics/testsWithStdLib/regression/kt9345.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/regression/kt9345.fir.kt deleted file mode 100644 index 5e21e489ac9..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/regression/kt9345.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -//KT-9345 Type inference failure - -fun Class<*>.foo(): Any? = kotlin.objectInstance \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/regression/kt9345.kt b/compiler/testData/diagnostics/testsWithStdLib/regression/kt9345.kt deleted file mode 100644 index 732617e137e..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/regression/kt9345.kt +++ /dev/null @@ -1,3 +0,0 @@ -//KT-9345 Type inference failure - -fun Class<*>.foo(): Any? = kotlin.objectInstance \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/regression/kt9345.txt b/compiler/testData/diagnostics/testsWithStdLib/regression/kt9345.txt deleted file mode 100644 index 7f5a2be6db5..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/regression/kt9345.txt +++ /dev/null @@ -1,3 +0,0 @@ -package - -public fun java.lang.Class<*>.foo(): kotlin.Any? diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/checkers/AbstractDiagnosticsTestWithStdLib.java b/compiler/tests-common/tests/org/jetbrains/kotlin/checkers/AbstractDiagnosticsTestWithStdLib.java index 6dc148c20ee..dcdd268634c 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/checkers/AbstractDiagnosticsTestWithStdLib.java +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/checkers/AbstractDiagnosticsTestWithStdLib.java @@ -1,17 +1,6 @@ /* - * Copyright 2010-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.checkers; @@ -23,6 +12,6 @@ public abstract class AbstractDiagnosticsTestWithStdLib extends AbstractDiagnost @NotNull @Override protected ConfigurationKind getConfigurationKind() { - return ConfigurationKind.ALL; + return ConfigurationKind.NO_KOTLIN_REFLECT; } } diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java index 6381c5eeda8..ad699a62514 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java @@ -17285,24 +17285,6 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest { } } - @TestMetadata("compiler/testData/diagnostics/tests/reflection") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Reflection extends AbstractDiagnosticsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInReflection() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/reflection"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); - } - - @TestMetadata("noReflectionInClassPath.kt") - public void testNoReflectionInClassPath() throws Exception { - runTest("compiler/testData/diagnostics/tests/reflection/noReflectionInClassPath.kt"); - } - } - @TestMetadata("compiler/testData/diagnostics/tests/regressions") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java index 866b0426e9f..5d33b4ed007 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java @@ -3231,6 +3231,11 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/reflection"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @TestMetadata("noReflectionInClassPath.kt") + public void testNoReflectionInClassPath() throws Exception { + runTest("compiler/testData/diagnostics/testsWithStdLib/reflection/noReflectionInClassPath.kt"); + } + @TestMetadata("typeOfWithNonReifiedParameter.kt") public void testTypeOfWithNonReifiedParameter() throws Exception { runTest("compiler/testData/diagnostics/testsWithStdLib/reflection/typeOfWithNonReifiedParameter.kt"); @@ -3294,11 +3299,6 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW runTest("compiler/testData/diagnostics/testsWithStdLib/regression/kt34391.kt"); } - @TestMetadata("kt9345.kt") - public void testKt9345() throws Exception { - runTest("compiler/testData/diagnostics/testsWithStdLib/regression/kt9345.kt"); - } - @TestMetadata("kt9820_javaFunctionTypeInheritor.kt") public void testKt9820_javaFunctionTypeInheritor() throws Exception { runTest("compiler/testData/diagnostics/testsWithStdLib/regression/kt9820_javaFunctionTypeInheritor.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java index 900cf8c7ada..69a56811d24 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java @@ -3231,6 +3231,11 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/reflection"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @TestMetadata("noReflectionInClassPath.kt") + public void testNoReflectionInClassPath() throws Exception { + runTest("compiler/testData/diagnostics/testsWithStdLib/reflection/noReflectionInClassPath.kt"); + } + @TestMetadata("typeOfWithNonReifiedParameter.kt") public void testTypeOfWithNonReifiedParameter() throws Exception { runTest("compiler/testData/diagnostics/testsWithStdLib/reflection/typeOfWithNonReifiedParameter.kt"); @@ -3294,11 +3299,6 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno runTest("compiler/testData/diagnostics/testsWithStdLib/regression/kt34391.kt"); } - @TestMetadata("kt9345.kt") - public void testKt9345() throws Exception { - runTest("compiler/testData/diagnostics/testsWithStdLib/regression/kt9345.kt"); - } - @TestMetadata("kt9820_javaFunctionTypeInheritor.kt") public void testKt9820_javaFunctionTypeInheritor() throws Exception { runTest("compiler/testData/diagnostics/testsWithStdLib/regression/kt9820_javaFunctionTypeInheritor.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java index ead08c2f4c0..acdc65f36b8 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java @@ -17275,24 +17275,6 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing } } - @TestMetadata("compiler/testData/diagnostics/tests/reflection") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Reflection extends AbstractDiagnosticsUsingJavacTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInReflection() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/reflection"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); - } - - @TestMetadata("noReflectionInClassPath.kt") - public void testNoReflectionInClassPath() throws Exception { - runTest("compiler/testData/diagnostics/tests/reflection/noReflectionInClassPath.kt"); - } - } - @TestMetadata("compiler/testData/diagnostics/tests/regressions") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index 1bcff920cfd..a5659d25810 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -25948,6 +25948,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/regressions/kt864.kt"); } + @TestMetadata("kt9345.kt") + public void testKt9345() throws Exception { + runTest("compiler/testData/codegen/box/regressions/kt9345.kt"); + } + @TestMetadata("kt998.kt") public void testKt998() throws Exception { runTest("compiler/testData/codegen/box/regressions/kt998.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index e251925eb0d..4eb805e115b 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -24765,6 +24765,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/regressions/kt864.kt"); } + @TestMetadata("kt9345.kt") + public void testKt9345() throws Exception { + runTest("compiler/testData/codegen/box/regressions/kt9345.kt"); + } + @TestMetadata("kt998.kt") public void testKt998() throws Exception { runTest("compiler/testData/codegen/box/regressions/kt998.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java index 360afe6ba37..3462893016c 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java @@ -24447,6 +24447,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/regressions/kt864.kt"); } + @TestMetadata("kt9345.kt") + public void testKt9345() throws Exception { + runTest("compiler/testData/codegen/box/regressions/kt9345.kt"); + } + @TestMetadata("kt998.kt") public void testKt998() throws Exception { runTest("compiler/testData/codegen/box/regressions/kt998.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index ab698cfe44f..85cd454a3a9 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -24447,6 +24447,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/regressions/kt864.kt"); } + @TestMetadata("kt9345.kt") + public void testKt9345() throws Exception { + runTest("compiler/testData/codegen/box/regressions/kt9345.kt"); + } + @TestMetadata("kt998.kt") public void testKt998() throws Exception { runTest("compiler/testData/codegen/box/regressions/kt998.kt");