Files
kotlin-fork/compiler/testData/codegen/box/evaluate/stringConcatenationWithObject.kt
T
Ivan Kylchik 5b16b2c71e Properly verify args in string concatenation expression for interpreter
If string concatenation contains object value, then this argument
will not have explicit toString call. We must find and check toString
method manually.

#KT-54615
2022-10-24 13:14:16 +00:00

15 lines
254 B
Kotlin
Vendored

// TARGET_BACKEND: JVM_IR
object K : Code("K")
open class Code(val x: String) {
override fun toString() = "$x"
}
class O {
companion object: Code("O")
}
fun box(): String {
return "$O" + "$K" // must not be evaluated during compile time
}