KT-3273 Return type coalesces to Tuple0 in when/if nested clauses
#KT-3273 Fixed
This commit is contained in:
@@ -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"
|
||||||
|
}
|
||||||
@@ -486,4 +486,9 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt3203_2.kt");
|
blackBoxFile("regressions/kt3203_2.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testKt3273() {
|
||||||
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
|
blackBoxFile("regressions/kt3273.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user