Skip to content

Commit

Permalink
Fix not working on Kotlin/JS or Kotlin/Native.
Browse files Browse the repository at this point in the history
  • Loading branch information
bennyhuo committed Mar 21, 2023
1 parent 03c7ef3 commit 7545233
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import org.jetbrains.kotlin.ir.expressions.impl.IrConstImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrStringConcatenationImpl
import org.jetbrains.kotlin.ir.types.classFqName
import org.jetbrains.kotlin.ir.util.fqNameWhenAvailable
import org.jetbrains.kotlin.ir.util.getPackageFragment
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import kotlin.contracts.ExperimentalContracts
Expand All @@ -33,7 +34,7 @@ internal fun IrCall.isTrimIndent(): Boolean {
return symbol.owner.name == Name.identifier("trimIndent")
&& dispatchReceiver == null
&& extensionReceiver?.type?.classFqName?.asString() == "kotlin.String"
&& symbol.owner.fqNameWhenAvailable?.parent()?.asString() == "kotlin.text.StringsKt"
&& symbol.owner.getPackageFragment()?.fqName?.asString() == "kotlin.text"
}

fun IrPluginContext.prependIndent(): IrFunction {
Expand Down

0 comments on commit 7545233

Please sign in to comment.