diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java index 6634b3db8fc..b4e8f9d15cc 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java @@ -2050,11 +2050,26 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/callableReference/javaField.kt"); } + @TestMetadata("kt16752.kt") + public void testKt16752() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt16752.kt"); + } + @TestMetadata("kt21014.kt") public void testKt21014() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt21014.kt"); } + @TestMetadata("kt21092a.kt") + public void testKt21092a() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt21092a.kt"); + } + + @TestMetadata("kt21092b.kt") + public void testKt21092b() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt21092b.kt"); + } + @TestMetadata("kt37604.kt") public void testKt37604() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt37604.kt"); diff --git a/compiler/testData/codegen/box/callableReference/kt21092a.kt b/compiler/testData/codegen/box/callableReference/kt21092a.kt new file mode 100644 index 00000000000..579de21cd37 --- /dev/null +++ b/compiler/testData/codegen/box/callableReference/kt21092a.kt @@ -0,0 +1,26 @@ +// IGNORE_BACKEND: JVM +// WITH_RUNTIME +// DONT_TARGET_EXACT_BACKEND: WASM +// WASM_MUTE_REASON: PROPERTY_REFERENCES + +val T.foo get() = 42 + +class A + +inline class Z(val x: Int) + +fun box(): String { + val test1 = A::foo.get(A()) + if (test1 != 42) throw Exception("test1: $test1") + + val test2 = String::foo.get("") + if (test2 != 42) throw Exception("test2: $test2") + + val test3 = Int::foo.get(1) + if (test3 != 42) throw Exception("test3: $test3") + + val test4 = Z::foo.get(Z(1)) + if (test4 != 42) throw Exception("test4: $test4") + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/callableReference/kt21092b.kt b/compiler/testData/codegen/box/callableReference/kt21092b.kt new file mode 100644 index 00000000000..96593e9621c --- /dev/null +++ b/compiler/testData/codegen/box/callableReference/kt21092b.kt @@ -0,0 +1,12 @@ +// TARGET_BACKEND: JVM +// IGNORE_BACKEND: JVM +// WITH_RUNTIME + +class A(val b: T) + +fun box(): String { + val test = A(1).b::javaClass.get().simpleName + if (test != "Integer") throw Exception("test: $test") + + return "OK" +} \ No newline at end of file diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index e410564744f..6a7345b3de1 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -2050,11 +2050,26 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/callableReference/javaField.kt"); } + @TestMetadata("kt16752.kt") + public void testKt16752() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt16752.kt"); + } + @TestMetadata("kt21014.kt") public void testKt21014() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt21014.kt"); } + @TestMetadata("kt21092a.kt") + public void testKt21092a() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt21092a.kt"); + } + + @TestMetadata("kt21092b.kt") + public void testKt21092b() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt21092b.kt"); + } + @TestMetadata("kt37604.kt") public void testKt37604() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt37604.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index f0a0aa30766..d67397acedb 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -2017,11 +2017,26 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class CallableReference extends AbstractLightAnalysisModeTest { + @TestMetadata("kt16752.kt") + public void ignoreKt16752() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt16752.kt"); + } + @TestMetadata("kt21014.kt") public void ignoreKt21014() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt21014.kt"); } + @TestMetadata("kt21092a.kt") + public void ignoreKt21092a() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt21092a.kt"); + } + + @TestMetadata("kt21092b.kt") + public void ignoreKt21092b() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt21092b.kt"); + } + private void runTest(String testDataFilePath) throws Exception { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index 68ee076bc8b..a92d87766cf 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -2050,11 +2050,26 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/callableReference/javaField.kt"); } + @TestMetadata("kt16752.kt") + public void testKt16752() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt16752.kt"); + } + @TestMetadata("kt21014.kt") public void testKt21014() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt21014.kt"); } + @TestMetadata("kt21092a.kt") + public void testKt21092a() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt21092a.kt"); + } + + @TestMetadata("kt21092b.kt") + public void testKt21092b() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt21092b.kt"); + } + @TestMetadata("kt37604.kt") public void testKt37604() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt37604.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java index a80ed5ea8df..acec6f20e1f 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java @@ -1470,11 +1470,21 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes runTest("compiler/testData/codegen/box/callableReference/genericLocalClassConstructorReference.kt"); } + @TestMetadata("kt16752.kt") + public void testKt16752() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt16752.kt"); + } + @TestMetadata("kt21014.kt") public void testKt21014() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt21014.kt"); } + @TestMetadata("kt21092a.kt") + public void testKt21092a() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt21092a.kt"); + } + @TestMetadata("kt37604.kt") public void testKt37604() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt37604.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index 6152b0e11f5..de42e414064 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -1470,11 +1470,21 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/callableReference/genericLocalClassConstructorReference.kt"); } + @TestMetadata("kt16752.kt") + public void testKt16752() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt16752.kt"); + } + @TestMetadata("kt21014.kt") public void testKt21014() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt21014.kt"); } + @TestMetadata("kt21092a.kt") + public void testKt21092a() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt21092a.kt"); + } + @TestMetadata("kt37604.kt") public void testKt37604() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt37604.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index b150dd2cc62..fd0aad9d307 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -1470,11 +1470,21 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/callableReference/genericLocalClassConstructorReference.kt"); } + @TestMetadata("kt16752.kt") + public void testKt16752() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt16752.kt"); + } + @TestMetadata("kt21014.kt") public void testKt21014() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt21014.kt"); } + @TestMetadata("kt21092a.kt") + public void testKt21092a() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt21092a.kt"); + } + @TestMetadata("kt37604.kt") public void testKt37604() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt37604.kt");