From 99ec3215d93d6d9c6df7814ce6eba3de83aa3d5f Mon Sep 17 00:00:00 2001 From: Igor Chevdar Date: Thu, 2 Mar 2023 15:46:27 +0200 Subject: [PATCH] [box-tests] Added a reproducer for KT-57053 --- ...irLightTreeBlackBoxInlineCodegenTestGenerated.java | 6 ++++++ ...CompileKotlinAgainstInlineKotlinTestGenerated.java | 6 ++++++ .../FirPsiBlackBoxInlineCodegenTestGenerated.java | 6 ++++++ ...CompileKotlinAgainstInlineKotlinTestGenerated.java | 6 ++++++ .../codegen/boxInline/anonymousObject/kt57053.kt | 11 +++++++++++ .../codegen/BlackBoxInlineCodegenTestGenerated.java | 6 ++++++ ...CompileKotlinAgainstInlineKotlinTestGenerated.java | 6 ++++++ .../codegen/IrBlackBoxInlineCodegenTestGenerated.java | 6 ++++++ ...CompileKotlinAgainstInlineKotlinTestGenerated.java | 6 ++++++ ...CompileKotlinAgainstInlineKotlinTestGenerated.java | 6 ++++++ .../JvmIrAgainstOldBoxInlineTestGenerated.java | 6 ++++++ .../JvmOldAgainstIrBoxInlineTestGenerated.java | 6 ++++++ .../kotlin/js/test/JsCodegenInlineTestGenerated.java | 6 ++++++ .../js/test/fir/FirJsCodegenInlineTestGenerated.java | 6 ++++++ .../js/test/ir/IrJsCodegenInlineTestGenerated.java | 6 ++++++ .../js/test/ir/IrJsES6CodegenInlineTestGenerated.java | 6 ++++++ .../blackboxtest/K2NativeCodegenBoxTestGenerated.java | 6 ++++++ .../blackboxtest/NativeCodegenBoxTestGenerated.java | 6 ++++++ .../test/IrCodegenBoxInlineWasmTestGenerated.java | 5 +++++ 19 files changed, 118 insertions(+) create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/kt57053.kt diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxInlineCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxInlineCodegenTestGenerated.java index a3abd80cd9a..ccbb773e8e5 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxInlineCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxInlineCodegenTestGenerated.java @@ -392,6 +392,12 @@ public class FirLightTreeBlackBoxInlineCodegenTestGenerated extends AbstractFirL runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_5.kt"); } + @Test + @TestMetadata("kt57053.kt") + public void testKt57053() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/kt57053.kt"); + } + @Test @TestMetadata("kt6007.kt") public void testKt6007() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java index 7db1fea808f..0fa562d9684 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java @@ -392,6 +392,12 @@ public class FirLightTreeSerializeCompileKotlinAgainstInlineKotlinTestGenerated runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_5.kt"); } + @Test + @TestMetadata("kt57053.kt") + public void testKt57053() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/kt57053.kt"); + } + @Test @TestMetadata("kt6007.kt") public void testKt6007() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxInlineCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxInlineCodegenTestGenerated.java index a69c5e2a8ce..c7e00cade5d 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxInlineCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxInlineCodegenTestGenerated.java @@ -392,6 +392,12 @@ public class FirPsiBlackBoxInlineCodegenTestGenerated extends AbstractFirPsiBlac runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_5.kt"); } + @Test + @TestMetadata("kt57053.kt") + public void testKt57053() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/kt57053.kt"); + } + @Test @TestMetadata("kt6007.kt") public void testKt6007() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java index 6804bf13935..e14f9a7f9ea 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java @@ -392,6 +392,12 @@ public class FirPsiSerializeCompileKotlinAgainstInlineKotlinTestGenerated extend runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_5.kt"); } + @Test + @TestMetadata("kt57053.kt") + public void testKt57053() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/kt57053.kt"); + } + @Test @TestMetadata("kt6007.kt") public void testKt6007() throws Exception { diff --git a/compiler/testData/codegen/boxInline/anonymousObject/kt57053.kt b/compiler/testData/codegen/boxInline/anonymousObject/kt57053.kt new file mode 100644 index 00000000000..3de622b47af --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/kt57053.kt @@ -0,0 +1,11 @@ +// FILE: 1.kt +inline fun foo(): String { + val obj = object { + fun localDefault(s: String = "OK") = s + fun local() = localDefault() + } + return obj.local() +} + +// FILE: 2.kt +fun box() = foo() \ No newline at end of file diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxInlineCodegenTestGenerated.java index e3792e018db..f476ceb734e 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxInlineCodegenTestGenerated.java @@ -392,6 +392,12 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_5.kt"); } + @Test + @TestMetadata("kt57053.kt") + public void testKt57053() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/kt57053.kt"); + } + @Test @TestMetadata("kt6007.kt") public void testKt6007() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java index eaacf76c645..76f2d88bd0e 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -392,6 +392,12 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_5.kt"); } + @Test + @TestMetadata("kt57053.kt") + public void testKt57053() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/kt57053.kt"); + } + @Test @TestMetadata("kt6007.kt") public void testKt6007() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxInlineCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxInlineCodegenTestGenerated.java index e90c5ab9caf..50fcdb4320d 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxInlineCodegenTestGenerated.java @@ -392,6 +392,12 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_5.kt"); } + @Test + @TestMetadata("kt57053.kt") + public void testKt57053() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/kt57053.kt"); + } + @Test @TestMetadata("kt6007.kt") public void testKt6007() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrCompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrCompileKotlinAgainstInlineKotlinTestGenerated.java index e260fa9f630..3bf3bf69bf4 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrCompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrCompileKotlinAgainstInlineKotlinTestGenerated.java @@ -392,6 +392,12 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_5.kt"); } + @Test + @TestMetadata("kt57053.kt") + public void testKt57053() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/kt57053.kt"); + } + @Test @TestMetadata("kt6007.kt") public void testKt6007() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java index e77141bbb34..092c3fb60cd 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java @@ -392,6 +392,12 @@ public class IrSerializeCompileKotlinAgainstInlineKotlinTestGenerated extends Ab runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_5.kt"); } + @Test + @TestMetadata("kt57053.kt") + public void testKt57053() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/kt57053.kt"); + } + @Test @TestMetadata("kt6007.kt") public void testKt6007() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmIrAgainstOldBoxInlineTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmIrAgainstOldBoxInlineTestGenerated.java index 1bb4dc6d2a3..63b7982ff3b 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmIrAgainstOldBoxInlineTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmIrAgainstOldBoxInlineTestGenerated.java @@ -392,6 +392,12 @@ public class JvmIrAgainstOldBoxInlineTestGenerated extends AbstractJvmIrAgainstO runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_5.kt"); } + @Test + @TestMetadata("kt57053.kt") + public void testKt57053() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/kt57053.kt"); + } + @Test @TestMetadata("kt6007.kt") public void testKt6007() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmOldAgainstIrBoxInlineTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmOldAgainstIrBoxInlineTestGenerated.java index 5a36e4b16a4..7c8ec04dfc6 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmOldAgainstIrBoxInlineTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmOldAgainstIrBoxInlineTestGenerated.java @@ -392,6 +392,12 @@ public class JvmOldAgainstIrBoxInlineTestGenerated extends AbstractJvmOldAgainst runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_5.kt"); } + @Test + @TestMetadata("kt57053.kt") + public void testKt57053() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/kt57053.kt"); + } + @Test @TestMetadata("kt6007.kt") public void testKt6007() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenInlineTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenInlineTestGenerated.java index 4fbb742a33f..be6fdc4d83c 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenInlineTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenInlineTestGenerated.java @@ -350,6 +350,12 @@ public class JsCodegenInlineTestGenerated extends AbstractJsCodegenInlineTest { runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_5.kt"); } + @Test + @TestMetadata("kt57053.kt") + public void testKt57053() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/kt57053.kt"); + } + @Test @TestMetadata("kt6007.kt") public void testKt6007() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenInlineTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenInlineTestGenerated.java index 28f0d2249f2..645d5118c7d 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenInlineTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenInlineTestGenerated.java @@ -350,6 +350,12 @@ public class FirJsCodegenInlineTestGenerated extends AbstractFirJsCodegenInlineT runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_5.kt"); } + @Test + @TestMetadata("kt57053.kt") + public void testKt57053() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/kt57053.kt"); + } + @Test @TestMetadata("kt6007.kt") public void testKt6007() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenInlineTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenInlineTestGenerated.java index addb4c1833f..a970ffe5bf0 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenInlineTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenInlineTestGenerated.java @@ -350,6 +350,12 @@ public class IrJsCodegenInlineTestGenerated extends AbstractIrJsCodegenInlineTes runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_5.kt"); } + @Test + @TestMetadata("kt57053.kt") + public void testKt57053() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/kt57053.kt"); + } + @Test @TestMetadata("kt6007.kt") public void testKt6007() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenInlineTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenInlineTestGenerated.java index 830d9f89d05..b9c54a14945 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenInlineTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenInlineTestGenerated.java @@ -350,6 +350,12 @@ public class IrJsES6CodegenInlineTestGenerated extends AbstractIrJsES6CodegenInl runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_5.kt"); } + @Test + @TestMetadata("kt57053.kt") + public void testKt57053() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/kt57053.kt"); + } + @Test @TestMetadata("kt6007.kt") public void testKt6007() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/K2NativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/K2NativeCodegenBoxTestGenerated.java index 0f458e09553..1d5f1b9ceac 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/K2NativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/K2NativeCodegenBoxTestGenerated.java @@ -41594,6 +41594,12 @@ public class K2NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTes runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_5.kt"); } + @Test + @TestMetadata("kt57053.kt") + public void testKt57053() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/kt57053.kt"); + } + @Test @TestMetadata("kt6007.kt") public void testKt6007() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java index b43c618184a..2ea95868f10 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java @@ -41078,6 +41078,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_5.kt"); } + @Test + @TestMetadata("kt57053.kt") + public void testKt57053() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/kt57053.kt"); + } + @Test @TestMetadata("kt6007.kt") public void testKt6007() throws Exception { diff --git a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/IrCodegenBoxInlineWasmTestGenerated.java b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/IrCodegenBoxInlineWasmTestGenerated.java index 679f9a772ca..eef94a7fee6 100644 --- a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/IrCodegenBoxInlineWasmTestGenerated.java +++ b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/IrCodegenBoxInlineWasmTestGenerated.java @@ -310,6 +310,11 @@ public class IrCodegenBoxInlineWasmTestGenerated extends AbstractIrCodegenBoxInl runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_5.kt"); } + @TestMetadata("kt57053.kt") + public void testKt57053() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/kt57053.kt"); + } + @TestMetadata("kt6007.kt") public void testKt6007() throws Exception { runTest("compiler/testData/codegen/boxInline/anonymousObject/kt6007.kt");