Files
kotlin-fork/backend.native/tests/external/codegen/box/smartCasts/smartCastInsideIf.kt
T
2017-03-13 15:31:46 +03:00

16 lines
254 B
Kotlin

class A(val s: String = "FAIL")
private fun foo(a: A?, aOther: A?): A {
return if (a == null) {
A()
}
else {
if (aOther == null) {
return A()
}
aOther
}
}
fun box() = foo(A("???"), A("OK")).s