diff --git a/compiler/testData/codegen/regressions/kt3273.kt b/compiler/testData/codegen/regressions/kt3273.kt new file mode 100644 index 00000000000..2e13e6370ae --- /dev/null +++ b/compiler/testData/codegen/regressions/kt3273.kt @@ -0,0 +1,17 @@ +public fun testCoalesce() { + val value: String = when { + true -> { + if (true) { + "foo" + } else { + "bar" + } + } + else -> "Hello world" + } +} + +fun box(): String { + testCoalesce() + return "OK" +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/codegen/ControlStructuresTest.java b/compiler/tests/org/jetbrains/jet/codegen/ControlStructuresTest.java index bd3b57c0981..5730bde3a30 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/ControlStructuresTest.java +++ b/compiler/tests/org/jetbrains/jet/codegen/ControlStructuresTest.java @@ -486,4 +486,9 @@ public class ControlStructuresTest extends CodegenTestCase { createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY); blackBoxFile("regressions/kt3203_2.kt"); } + + public void testKt3273() { + createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY); + blackBoxFile("regressions/kt3273.kt"); + } }