Remove Concat and StringPlus intrinsics in favor of IrStringConcatenation.
This commit is contained in:
committed by
max-kammerer
parent
26c9d69252
commit
f2392a6a28
@@ -0,0 +1,18 @@
|
||||
fun f(s: String?, t: String): String {
|
||||
return s.plus(t)
|
||||
}
|
||||
|
||||
fun g(s: String, t: Any?): String {
|
||||
return "$s$t"
|
||||
}
|
||||
|
||||
fun h(s: String, t: Any?): String {
|
||||
return s + t
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
if (f("O", "K") != "OK") return "Fail 1"
|
||||
if (g("O", "K") != "OK") return "Fail 2"
|
||||
if (h("O", "K") != "OK") return "Fail 3"
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
fun f(s: String?): String {
|
||||
return "$s"
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
if (f(null) != "null") return "Fail"
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
operator fun String?.plus(p: String): String {
|
||||
return "" + this
|
||||
}
|
||||
|
||||
fun test(a: String?, b: String): String {
|
||||
return a + b
|
||||
}
|
||||
|
||||
fun box() = test("OK", " Fail")
|
||||
Reference in New Issue
Block a user