mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-04-16 08:31:26 +00:00
We can only use IrStrinConcatentation to represent calls to Any?.toString and toString calls on primitive types. Otherwise, x.toString() and "$x" are observably different when x is a non-null type with null value (e.g., an @NotNull value coming from Java).
12 lines
248 B
Kotlin
Vendored
12 lines
248 B
Kotlin
Vendored
val chars = listOf('O', 'K')
|
|
|
|
fun box(): String {
|
|
val b = StringBuilder()
|
|
for (c in chars) {
|
|
b.append(c)
|
|
}
|
|
return b.toString()
|
|
}
|
|
|
|
// 0 INVOKESTATIC java/lang/String.valueOf
|
|
// 1 INVOKEVIRTUAL java/lang/StringBuilder.toString |