JVM_IR KT-50076 avoid CHECKCAST on moved dispatch receiver parameter

This commit is contained in:
Dmitry Petrov
2021-12-13 10:33:04 +03:00
committed by Space
parent 6f148c594f
commit df460a842b
16 changed files with 223 additions and 11 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)