Fix String?.plus extraction

This commit is contained in:
Tamas Vajk
2021-11-26 14:30:47 +01:00
committed by Ian Lynagh
parent ea4e919af5
commit 23c5caadc8
3 changed files with 2 additions and 5 deletions

View File

@@ -744,9 +744,7 @@ open class KotlinFileExtractor(
when {
c.origin == IrStatementOrigin.PLUS &&
(isNumericFunction("plus")
|| isFunction("kotlin", "String", "plus")
|| isFunction("kotlin", "String", "plus", true) // TODO: this is not correct. `a + b` becomes `(a?:"\"null\"") + (b?:"\"null\"")`.
) -> {
|| isFunction("kotlin", "String", "plus")) -> {
val id = tw.getFreshIdLabel<DbAddexpr>()
val type = useType(c.type)
tw.writeExprs_addexpr(id, type.javaResult.id, type.kotlinResult.id, parent, idx)