From 6aaa6012398706835b8a8825e436388b28f3fc7c Mon Sep 17 00:00:00 2001 From: Mikhael Bogdanov Date: Thu, 7 Feb 2019 11:28:46 +0100 Subject: [PATCH] Add tests for obsolete issues #KT-21085 Obsolete #KT-13846 Obsolete --- .../box/delegatedProperty/local/kt21085.kt | 15 +++++++++++++++ .../codegen/box/super/superConstructor/kt13846.kt | 14 ++++++++++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 10 ++++++++++ .../codegen/LightAnalysisModeTestGenerated.java | 10 ++++++++++ .../ir/IrBlackBoxCodegenTestGenerated.java | 10 ++++++++++ .../semantics/IrJsCodegenBoxTestGenerated.java | 10 ++++++++++ .../test/semantics/JsCodegenBoxTestGenerated.java | 10 ++++++++++ 7 files changed, 79 insertions(+) create mode 100644 compiler/testData/codegen/box/delegatedProperty/local/kt21085.kt create mode 100644 compiler/testData/codegen/box/super/superConstructor/kt13846.kt diff --git a/compiler/testData/codegen/box/delegatedProperty/local/kt21085.kt b/compiler/testData/codegen/box/delegatedProperty/local/kt21085.kt new file mode 100644 index 00000000000..1a91c431fe7 --- /dev/null +++ b/compiler/testData/codegen/box/delegatedProperty/local/kt21085.kt @@ -0,0 +1,15 @@ +// IGNORE_BACKEND: JVM_IR + +class Delegate(val value: String) { + operator fun getValue(thisRef: Any?, kProperty: Any?) = value +} + +fun box(): String { + val x by Delegate("O") + + class Local(val y: String) { + val fn = { x + y } + } + + return Local("K").fn() +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/super/superConstructor/kt13846.kt b/compiler/testData/codegen/box/super/superConstructor/kt13846.kt new file mode 100644 index 00000000000..c066d8e6ce5 --- /dev/null +++ b/compiler/testData/codegen/box/super/superConstructor/kt13846.kt @@ -0,0 +1,14 @@ +open class SuperClass(val arg: () -> String) + +object obj { + + fun foo(): String { + return "OK" + } + + class Foo : SuperClass(::foo) +} + +fun box(): String { + return obj.Foo().arg() +} diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index 6b9fc879b9e..6caf0dff871 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -9250,6 +9250,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/delegatedProperty/local/kt19690.kt"); } + @TestMetadata("kt21085.kt") + public void testKt21085() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/local/kt21085.kt"); + } + @TestMetadata("kt23117.kt") public void testKt23117() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/local/kt23117.kt"); @@ -23399,6 +23404,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/super/superConstructor"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } + @TestMetadata("kt13846.kt") + public void testKt13846() throws Exception { + runTest("compiler/testData/codegen/box/super/superConstructor/kt13846.kt"); + } + @TestMetadata("kt17464_arrayOf.kt") public void testKt17464_arrayOf() throws Exception { runTest("compiler/testData/codegen/box/super/superConstructor/kt17464_arrayOf.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index bc939be4f14..b861c3e6034 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -9250,6 +9250,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/delegatedProperty/local/kt19690.kt"); } + @TestMetadata("kt21085.kt") + public void testKt21085() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/local/kt21085.kt"); + } + @TestMetadata("kt23117.kt") public void testKt23117() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/local/kt23117.kt"); @@ -23399,6 +23404,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/super/superConstructor"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } + @TestMetadata("kt13846.kt") + public void testKt13846() throws Exception { + runTest("compiler/testData/codegen/box/super/superConstructor/kt13846.kt"); + } + @TestMetadata("kt17464_arrayOf.kt") public void testKt17464_arrayOf() throws Exception { runTest("compiler/testData/codegen/box/super/superConstructor/kt17464_arrayOf.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index fa7e5fe3bb4..92fe340f818 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -9250,6 +9250,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/delegatedProperty/local/kt19690.kt"); } + @TestMetadata("kt21085.kt") + public void testKt21085() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/local/kt21085.kt"); + } + @TestMetadata("kt23117.kt") public void testKt23117() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/local/kt23117.kt"); @@ -23404,6 +23409,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/super/superConstructor"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } + @TestMetadata("kt13846.kt") + public void testKt13846() throws Exception { + runTest("compiler/testData/codegen/box/super/superConstructor/kt13846.kt"); + } + @TestMetadata("kt17464_arrayOf.kt") public void testKt17464_arrayOf() throws Exception { runTest("compiler/testData/codegen/box/super/superConstructor/kt17464_arrayOf.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java index b0c88167df8..d491c4eac18 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java @@ -7135,6 +7135,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/delegatedProperty/local/kt19690.kt"); } + @TestMetadata("kt21085.kt") + public void testKt21085() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/local/kt21085.kt"); + } + @TestMetadata("kt23117.kt") public void testKt23117() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/local/kt23117.kt"); @@ -18004,6 +18009,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/super/superConstructor"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } + @TestMetadata("kt13846.kt") + public void testKt13846() throws Exception { + runTest("compiler/testData/codegen/box/super/superConstructor/kt13846.kt"); + } + @TestMetadata("kt17464_arrayOf.kt") public void testKt17464_arrayOf() throws Exception { runTest("compiler/testData/codegen/box/super/superConstructor/kt17464_arrayOf.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 45f74ca98c1..e5c7eb06071 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -8225,6 +8225,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/delegatedProperty/local/kt19690.kt"); } + @TestMetadata("kt21085.kt") + public void testKt21085() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/local/kt21085.kt"); + } + @TestMetadata("kt23117.kt") public void testKt23117() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/local/kt23117.kt"); @@ -19094,6 +19099,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/super/superConstructor"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } + @TestMetadata("kt13846.kt") + public void testKt13846() throws Exception { + runTest("compiler/testData/codegen/box/super/superConstructor/kt13846.kt"); + } + @TestMetadata("kt17464_arrayOf.kt") public void testKt17464_arrayOf() throws Exception { runTest("compiler/testData/codegen/box/super/superConstructor/kt17464_arrayOf.kt");