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:
+18
@@ -0,0 +1,18 @@
|
||||
// FIR_IDENTICAL
|
||||
|
||||
object O : Code(0)
|
||||
|
||||
open class Code(val x: Int) {
|
||||
override fun toString() = "$x"
|
||||
}
|
||||
|
||||
class A {
|
||||
companion object: Code(0)
|
||||
}
|
||||
|
||||
const val toString1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>O.toString()<!>
|
||||
const val toString2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>A.toString()<!>
|
||||
const val plusString1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>"string" + O<!>
|
||||
const val plusString2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>"string" + A<!>
|
||||
const val stringConcat1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>"$O"<!>
|
||||
const val stringConcat2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>"$A"<!>
|
||||
Reference in New Issue
Block a user