Remove error diagnostic from return in multideclaration

#KT-5100 Fixed
This commit is contained in:
Michael Bogdanov
2015-06-03 17:21:33 +03:00
parent a321e8eef5
commit 83f04501be
3 changed files with 34 additions and 1 deletions
@@ -0,0 +1,22 @@
data class Z(val p: String, val k: String)
fun create(p: Boolean): Z? {
return if (p) {
Z("O", "K")
}
else {
null;
}
}
fun test(p: Boolean): String {
val (a, b) = create(p) ?: return "null"
return a + b
}
fun box(): String {
if (test(false) != "null") return "fail 1: ${test(false)}"
return test(true)
}