[IR] Use deepCopyWithSymbols in IrTypeOperatorCall
This commit is contained in:
committed by
TeamCityServer
parent
7046f9badd
commit
084d824984
+6
-2
@@ -269,8 +269,12 @@ class TypeOperatorLowering(val context: JsIrBackendContext) : BodyLoweringPass {
|
||||
// assert(!typeParameter.isReified) { "reified parameters have to be lowered before" }
|
||||
|
||||
return typeParameter.superTypes.fold<IrType, IrExpression?>(null) { r, t ->
|
||||
require(argument is IrExpressionWithCopy) { "Not a copyable expression: ${argument.render()}" }
|
||||
val check = generateTypeCheckNonNull(argument.copy(), t.makeNotNull())
|
||||
val copy = if (argument is IrExpressionWithCopy) {
|
||||
argument.copy()
|
||||
} else {
|
||||
argument.deepCopyWithSymbols()
|
||||
}
|
||||
val check = generateTypeCheckNonNull(copy, t.makeNotNull())
|
||||
|
||||
if (r == null) {
|
||||
check
|
||||
|
||||
@@ -66,7 +66,7 @@ enum class IrTypeOperator {
|
||||
REINTERPRET_CAST;
|
||||
}
|
||||
|
||||
abstract class IrTypeOperatorCall : IrExpression(), IrExpressionWithCopy {
|
||||
abstract class IrTypeOperatorCall : IrExpression() {
|
||||
abstract val operator: IrTypeOperator
|
||||
abstract var argument: IrExpression
|
||||
abstract var typeOperand: IrType
|
||||
|
||||
-10
@@ -46,14 +46,4 @@ class IrTypeOperatorCallImpl(
|
||||
override fun <D> transformChildren(transformer: IrElementTransformer<D>, data: D) {
|
||||
argument = argument.transform(transformer, data)
|
||||
}
|
||||
|
||||
override fun copy(): IrExpression =
|
||||
IrTypeOperatorCallImpl(
|
||||
startOffset,
|
||||
endOffset,
|
||||
type,
|
||||
operator,
|
||||
typeOperand,
|
||||
argument
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user