diff --git a/compiler/testData/codegen/regressions/kt2288.kt b/compiler/testData/codegen/regressions/kt2288.kt new file mode 100644 index 00000000000..ce888361fb9 --- /dev/null +++ b/compiler/testData/codegen/regressions/kt2288.kt @@ -0,0 +1,8 @@ +public open class Test(): java.util.RandomAccess, Cloneable, java.io.Serializable +{ + public override fun clone(): Test = Test() // Override 'clone()' with more precise type 'Test' + + public override fun toString() = "OK" +} + +fun box() = Test().clone().toString() \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/codegen/ClassGenTest.java b/compiler/tests/org/jetbrains/jet/codegen/ClassGenTest.java index b751902d51f..1252512931d 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/ClassGenTest.java +++ b/compiler/tests/org/jetbrains/jet/codegen/ClassGenTest.java @@ -491,4 +491,11 @@ public class ClassGenTest extends CodegenTestCase { createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY); blackBoxMultiFile("regressions/kt2482.kt"); } + + public void testKt2288() { + createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY); + loadFile("regressions/kt2288.kt"); + //System.out.println(generateToText()); + blackBox(); + } }