Files
kotlin/compiler/testData/codegen/box/smartCasts/smartCastInsideIf.kt
2018-06-21 13:27:17 +03:00

16 lines
254 B
Kotlin
Vendored

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