[K2] Properly serialize constant values
#KT-56190 Fixed
This commit is contained in:
+5
-1
@@ -153,7 +153,11 @@ internal class DefaultCallInterceptor(override val interpreter: IrInterpreter) :
|
||||
val receiverType = irFunction.dispatchReceiverParameter?.type ?: irFunction.extensionReceiverParameter?.type
|
||||
val argsType = (listOfNotNull(receiverType) + irFunction.valueParameters.map { it.type }).map {
|
||||
// TODO: for consistency with current K/JS implementation Float constant should be treated as a Double (KT-35422)
|
||||
if (environment.configuration.treatFloatInSpecialWay && it.isFloat()) irBuiltIns.doubleType else it
|
||||
if (environment.configuration.treatFloatInSpecialWay && it.makeNotNull().isFloat()) {
|
||||
if (it.isNullable()) irBuiltIns.doubleType.makeNullable() else irBuiltIns.doubleType
|
||||
} else {
|
||||
it
|
||||
}
|
||||
}
|
||||
val argsValues = args.wrap(this, irFunction)
|
||||
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ enum class EvaluationMode(protected val mustCheckBody: Boolean) {
|
||||
private val forbiddenMethodsOnStrings = setOf("subSequence", "hashCode", "<init>")
|
||||
private val allowedExtensionFunctions = setOf(
|
||||
"kotlin.floorDiv", "kotlin.mod", "kotlin.NumbersKt.floorDiv", "kotlin.NumbersKt.mod", "kotlin.<get-code>",
|
||||
"kotlin.internal.ir.EQEQ",
|
||||
"kotlin.internal.ir.EQEQ", "kotlin.internal.ir.ieee754equals",
|
||||
)
|
||||
|
||||
override fun canEvaluateFunction(function: IrFunction, context: IrCall?): Boolean {
|
||||
|
||||
Reference in New Issue
Block a user