JVM IR: do not optimize casts for primitives in TypeOperatorLowering
#KT-48659 Fixed
This commit is contained in:
+2
-1
@@ -100,7 +100,8 @@ private class TypeOperatorLowering(private val context: JvmBackendContext) : Fil
|
||||
)
|
||||
}
|
||||
}
|
||||
argument.type.isSubtypeOfClass(type.erasedUpperBound.symbol) ->
|
||||
// Do not optimize casts for values of primitive types because it can affect their identity and thus change behavior.
|
||||
!argument.type.isPrimitiveType() && argument.type.isSubtypeOfClass(type.erasedUpperBound.symbol) ->
|
||||
argument
|
||||
else ->
|
||||
builder.irAs(argument, type)
|
||||
|
||||
Reference in New Issue
Block a user