From 00d7a0a8ae7a1c4a3ac561a4f438f5f400925b2e Mon Sep 17 00:00:00 2001 From: Alex Tkachman Date: Thu, 20 Sep 2012 16:44:46 +0300 Subject: [PATCH] test case for KT-2655 which duplicates KT-2786 --- .../testData/codegen/regressions/kt2655.kt | 20 +++++++++++++++++++ .../jet/codegen/PropertyGenTest.java | 5 +++++ 2 files changed, 25 insertions(+) create mode 100644 compiler/testData/codegen/regressions/kt2655.kt diff --git a/compiler/testData/codegen/regressions/kt2655.kt b/compiler/testData/codegen/regressions/kt2655.kt new file mode 100644 index 00000000000..d632ea14ad2 --- /dev/null +++ b/compiler/testData/codegen/regressions/kt2655.kt @@ -0,0 +1,20 @@ +trait TextField { + fun getText(): String + fun setText(text: String) +} + +class SimpleTextField : TextField { + private var text = "" + override fun getText() = text + override fun setText(text: String) { + this.text = text + } +} + +class TextFieldWrapper(textField: TextField) : TextField by textField + +fun box() : String { + val textField = TextFieldWrapper(SimpleTextField()) + textField.setText("OK") + return textField.getText() +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/codegen/PropertyGenTest.java b/compiler/tests/org/jetbrains/jet/codegen/PropertyGenTest.java index b6a39fba463..543fc116893 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/PropertyGenTest.java +++ b/compiler/tests/org/jetbrains/jet/codegen/PropertyGenTest.java @@ -282,6 +282,11 @@ public class PropertyGenTest extends CodegenTestCase { blackBoxFile("regressions/kt2786.kt"); } + public void testKt2655() throws Exception { + createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY); + blackBoxFile("regressions/kt2655.kt"); + } + public void testKt1528() throws Exception { createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY); blackBoxMultiFile("regressions/kt1528_1.kt", "regressions/kt1528_3.kt");