KotlinMangler: added IrType.isInlined

Added possibility to specify when IrType corresponds to an inline class
This commit is contained in:
Igor Chevdar
2019-05-14 18:55:39 +03:00
parent 8e579855f2
commit b060acf01d
2 changed files with 7 additions and 2 deletions
@@ -21,7 +21,7 @@ interface KotlinMangler {
val IrDeclaration.hashedMangle: Long
fun IrDeclaration.isExported(): Boolean
val IrFunction.functionName: String
val IrType.isInlined: Boolean
}
abstract class KotlinManglerImpl: KotlinMangler {
@@ -155,7 +155,7 @@ abstract class KotlinManglerImpl: KotlinMangler {
val signatureSuffix =
when {
this.typeParameters.isNotEmpty() -> "Generic"
returnType.isInlined() -> "ValueType"
returnType.isInlined -> "ValueType"
!returnType.isUnitOrNullableUnit() -> typeToHashString(returnType)
else -> ""
}
@@ -6,9 +6,14 @@
package org.jetbrains.kotlin.ir.backend.js.lower.serialization.ir
import org.jetbrains.kotlin.backend.common.serialization.KotlinManglerImpl
import org.jetbrains.kotlin.ir.types.IrType
import org.jetbrains.kotlin.ir.util.isInlined
object JsMangler: KotlinManglerImpl() {
// TODO: think about this
override val String.hashMangle: Long get() = this.hashCode().toLong()
override val IrType.isInlined: Boolean
get() = this.isInlined()
}