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
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
// 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
|
||||
}
|
||||
Reference in New Issue
Block a user