FIR: don't call toString() inside string concatenations

This commit is contained in:
Mikhail Glukhikh
2021-04-22 14:11:41 +03:00
parent 7dcdbf283b
commit f278de8768
48 changed files with 125 additions and 306 deletions
@@ -4,7 +4,7 @@ fun box(): String {
var i: Int = 0
while (x.hasNext()) { // BLOCK
when {
ieee754equals(arg0 = a.get(index = i), arg1 = x.next()).not() -> return "Fail " + i.toString()
ieee754equals(arg0 = a.get(index = i), arg1 = x.next()).not() -> return "Fail " + i
}
val <unary>: Int = i
i = <unary>.inc()
@@ -25,8 +25,7 @@ FILE fqName:<root> fileName:/coercionInLoop.kt
then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
STRING_CONCATENATION type=kotlin.String
CONST String type=kotlin.String value="Fail "
CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null
$this: GET_VAR 'var i: kotlin.Int [var] declared in <root>.box' type=kotlin.Int origin=null
GET_VAR 'var i: kotlin.Int [var] declared in <root>.box' type=kotlin.Int origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int [val]
GET_VAR 'var i: kotlin.Int [var] declared in <root>.box' type=kotlin.Int origin=null
SET_VAR 'var i: kotlin.Int [var] declared in <root>.box' type=kotlin.Unit origin=EQ