Files
kotlin-fork/compiler/testData/codegen/box/intrinsics/nullPlusString.kt
T
2020-02-27 22:13:32 +03:00

15 lines
381 B
Kotlin
Vendored

fun splus(s: String?, x: Any?) = s + x
fun box(): String {
val test1 = null + ""
if (test1 != "null") throw AssertionError("Fail: $test1")
val ns: String? = "abc"
val test2 = ns + ""
if (test2 != "abc") throw AssertionError("Fail: $test2")
val test3 = splus(null, null)
if (test3 != "nullnull") throw AssertionError("Fail: $test3")
return "OK"
}