diff --git a/compiler/testData/codegen/box/regressions/kt3107.kt b/compiler/testData/codegen/box/regressions/kt3107.kt new file mode 100644 index 00000000000..851d6931058 --- /dev/null +++ b/compiler/testData/codegen/box/regressions/kt3107.kt @@ -0,0 +1,17 @@ +fun foo(): String { + val s = try { + "OK" + } catch (e: Exception) { + try { + "" + } catch (ee: Exception) { + "" + } + } + + return s +} + +fun box(): String { + return foo() +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/regressions/kt3421.kt b/compiler/testData/codegen/box/regressions/kt3421.kt new file mode 100644 index 00000000000..05529fbcfa9 --- /dev/null +++ b/compiler/testData/codegen/box/regressions/kt3421.kt @@ -0,0 +1,9 @@ +public object Globals{ + public fun get(key: String, remove: Boolean = true): String { + return "OK" + } +} + +fun box(): String { + return Globals["test"] +} diff --git a/compiler/testData/codegen/box/regressions/kt3903.kt b/compiler/testData/codegen/box/regressions/kt3903.kt new file mode 100644 index 00000000000..ddb4e3e6766 --- /dev/null +++ b/compiler/testData/codegen/box/regressions/kt3903.kt @@ -0,0 +1,11 @@ +class Foo { + fun bar(): String { + fun foo(t:() -> T) : T = t() + foo { } + return "OK" + } +} + +fun box(): String { + return Foo().bar() +} diff --git a/compiler/testData/codegen/box/regressions/kt4281.kt b/compiler/testData/codegen/box/regressions/kt4281.kt new file mode 100644 index 00000000000..ff5af0bfef5 --- /dev/null +++ b/compiler/testData/codegen/box/regressions/kt4281.kt @@ -0,0 +1,15 @@ +abstract class C { + fun test(x: Int) { + if (x == 0) return + if (this is D) { + (this: D).test(x - 1) + } + } +} + +class D: C() + +fun box(): String { + D().test(10) + return "OK" +} diff --git a/compiler/testData/codegen/boxWithStdlib/regressions/kt3442.kt b/compiler/testData/codegen/boxWithStdlib/regressions/kt3442.kt new file mode 100644 index 00000000000..55f3226b19f --- /dev/null +++ b/compiler/testData/codegen/boxWithStdlib/regressions/kt3442.kt @@ -0,0 +1,6 @@ +fun box(): String { + val m = hashMapOf() + m.put("b", null) + val oldValue = m.getOrPut("b", { "Foo" }) + return if (oldValue == null) "OK" else "fail: $oldValue" +} diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxCodegenTestGenerated.java index cc289c28823..0b613033293 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxCodegenTestGenerated.java @@ -6037,24 +6037,48 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { doTest(fileName); } + @TestMetadata("kt3107.kt") + public void testKt3107() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/regressions/kt3107.kt"); + doTest(fileName); + } + @TestMetadata("kt3173.kt") public void testKt3173() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/regressions/kt3173.kt"); doTest(fileName); } + @TestMetadata("kt3421.kt") + public void testKt3421() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/regressions/kt3421.kt"); + doTest(fileName); + } + @TestMetadata("kt3587.kt") public void testKt3587() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/regressions/kt3587.kt"); doTest(fileName); } + @TestMetadata("kt3903.kt") + public void testKt3903() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/regressions/kt3903.kt"); + doTest(fileName); + } + @TestMetadata("kt3999.kt") public void testKt3999() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/regressions/kt3999.kt"); doTest(fileName); } + @TestMetadata("kt4281.kt") + public void testKt4281() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/regressions/kt4281.kt"); + doTest(fileName); + } + @TestMetadata("kt4682.kt") public void testKt4682() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/regressions/kt4682.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxWithStdlibCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxWithStdlibCodegenTestGenerated.java index 0a234871a95..5d95f8c08c5 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxWithStdlibCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxWithStdlibCodegenTestGenerated.java @@ -2892,6 +2892,12 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode doTestWithStdlib(fileName); } + @TestMetadata("kt3442.kt") + public void testKt3442() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/regressions/kt3442.kt"); + doTestWithStdlib(fileName); + } + @TestMetadata("kt4262.kt") public void testKt4262() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/regressions/kt4262.kt");