diff --git a/compiler/testData/codegen/boxWithStdlib/regressions/kt4142.kt b/compiler/testData/codegen/boxWithStdlib/regressions/kt4142.kt new file mode 100644 index 00000000000..e02b05f37bb --- /dev/null +++ b/compiler/testData/codegen/boxWithStdlib/regressions/kt4142.kt @@ -0,0 +1,16 @@ +open class B { + val name: String + get() = "OK" +} + +trait A { + val name: String +} + +class C : B(), A { + +} + +fun box(): String { + return C().name +} diff --git a/compiler/testData/codegen/boxWithStdlib/regressions/kt4259.kt b/compiler/testData/codegen/boxWithStdlib/regressions/kt4259.kt new file mode 100644 index 00000000000..7d609780d22 --- /dev/null +++ b/compiler/testData/codegen/boxWithStdlib/regressions/kt4259.kt @@ -0,0 +1,6 @@ +fun box(): String { + val s: String? = "a" + val o: Char? = s?.charAt(0) + val c: Any? = o?.javaClass + return if (c != null) "OK" else "fail" +} diff --git a/compiler/testData/codegen/boxWithStdlib/regressions/kt5395.kt b/compiler/testData/codegen/boxWithStdlib/regressions/kt5395.kt new file mode 100644 index 00000000000..11bb02ddf09 --- /dev/null +++ b/compiler/testData/codegen/boxWithStdlib/regressions/kt5395.kt @@ -0,0 +1,13 @@ +class D { + companion object { + protected val F: String = "OK" + } + + inner class E { + fun foo() = F + } +} + +fun box(): String { + return D().E().foo() +} diff --git a/compiler/testData/codegen/boxWithStdlib/regressions/kt5953.kt b/compiler/testData/codegen/boxWithStdlib/regressions/kt5953.kt new file mode 100644 index 00000000000..c18c893f441 --- /dev/null +++ b/compiler/testData/codegen/boxWithStdlib/regressions/kt5953.kt @@ -0,0 +1,11 @@ +fun box(): String { + val res = (1..3).map { it -> + if (it == 1) + 2 + }; + + var result = "" + for (i in res) + result += " " + return if (result == " ") "OK" else result +} diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxWithStdlibCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxWithStdlibCodegenTestGenerated.java index 861d4311ea3..b5f9d1ffad3 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxWithStdlibCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxWithStdlibCodegenTestGenerated.java @@ -3068,6 +3068,18 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode doTestWithStdlib(fileName); } + @TestMetadata("kt4142.kt") + public void testKt4142() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/regressions/kt4142.kt"); + doTestWithStdlib(fileName); + } + + @TestMetadata("kt4259.kt") + public void testKt4259() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/regressions/kt4259.kt"); + doTestWithStdlib(fileName); + } + @TestMetadata("kt4262.kt") public void testKt4262() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/regressions/kt4262.kt"); @@ -3098,6 +3110,18 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode doTestWithStdlib(fileName); } + @TestMetadata("kt5395.kt") + public void testKt5395() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/regressions/kt5395.kt"); + doTestWithStdlib(fileName); + } + + @TestMetadata("kt5953.kt") + public void testKt5953() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/regressions/kt5953.kt"); + doTestWithStdlib(fileName); + } + @TestMetadata("kt6434.kt") public void testKt6434() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/regressions/kt6434.kt");