Add toString function with nullable receiver into builtins map

On JVM we don't have body for this function, so we must process it as
intrinsic or builtin
This commit is contained in:
Ivan Kylchik
2021-05-13 23:23:36 +03:00
committed by TeamCityServer
parent 7882fdf232
commit 8234c9cec1
2 changed files with 2 additions and 0 deletions
@@ -49,6 +49,7 @@ fun generateMap(): String {
generateInterpretUnaryFunction(p, getOperationMap(1).apply {
val irNullCheck = irBuiltIns.checkNotNullSymbol.owner
this += Operation(irNullCheck.name.asString(), listOf("T0?"), customExpression = "a!!")
this += Operation("toString", listOf("Any?"), customExpression = "a?.toString() ?: \"null\"")
})
generateInterpretBinaryFunction(p, getOperationMap(2) + getBinaryIrOperationMap(irBuiltIns))