JVM_IR KT-50076 avoid CHECKCAST on moved dispatch receiver parameter

This commit is contained in:
Dmitry Petrov
2021-12-09 15:34:42 +03:00
committed by Space
parent 94bb465e62
commit 627d838343
12 changed files with 191 additions and 10 deletions
@@ -1050,6 +1050,12 @@ class ExpressionCodegen(
MaterialValue(this, boxedRightType, expression.type)
}
IrTypeOperator.REINTERPRET_CAST -> {
val targetType = typeMapper.mapType(typeOperand)
expression.argument.accept(this, data).materialize()
MaterialValue(this, targetType, typeOperand)
}
IrTypeOperator.INSTANCEOF -> {
expression.argument.accept(this, data).materializeAt(context.irBuiltIns.anyNType)
val type = typeMapper.boxType(typeOperand)