Codegen test for smart cast to Nothing?

This commit is contained in:
Mikhail Glukhikh
2015-11-25 15:00:58 +03:00
parent 9a6d4c32c5
commit a53ad098d6
2 changed files with 14 additions and 0 deletions
@@ -0,0 +1,8 @@
fun String?.foo() = this ?: "OK"
fun foo(i: Int?): String {
if (i == null) return i.foo()
return "$i"
}
fun box() = foo(null)