KT-37059 Support 'String?.plus(Any?)' in JVM_IR

This commit is contained in:
Dmitry Petrov
2020-02-27 13:24:35 +03:00
parent f9483b1f4f
commit ad0070ed8a
9 changed files with 81 additions and 0 deletions
@@ -0,0 +1,15 @@
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"
}