diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/LateinitLowering.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/LateinitLowering.kt index 19cf3aa4694..734353cf603 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/LateinitLowering.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/LateinitLowering.kt @@ -82,7 +82,7 @@ class LateinitLowering(val context: CommonBackendContext) : FileLoweringPass { ).also { descriptor.bind(it) it.parent = declaration.parent - it.initializer = IrConstImpl.constNull(declaration.startOffset, declaration.endOffset, type) + it.initializer = IrConstImpl.constNull(declaration.startOffset, declaration.endOffset, context.irBuiltIns.nothingNType) } nullableVariables[declaration] = newVar diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/JvmOverloadsAnnotationLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/JvmOverloadsAnnotationLowering.kt index 9d82fe8e331..2cf53bcea77 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/JvmOverloadsAnnotationLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/JvmOverloadsAnnotationLowering.kt @@ -60,7 +60,7 @@ private class JvmOverloadsAnnotationLowering(val context: JvmBackendContext) : C val wrapperIrFunction = generateWrapperHeader(target, numDefaultParametersToExpect) val call = if (target is IrConstructor) - IrDelegatingConstructorCallImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, target.returnType, target.symbol, target.descriptor) + IrDelegatingConstructorCallImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, context.irBuiltIns.unitType, target.symbol, target.descriptor) else IrCallImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, target.returnType, target.symbol) call.dispatchReceiver = wrapperIrFunction.dispatchReceiverParameter?.let { dispatchReceiver -> diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/CallGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/CallGenerator.kt index c82e011e471..a07815e48f8 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/CallGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/CallGenerator.kt @@ -161,9 +161,8 @@ class CallGenerator(statementGenerator: StatementGenerator) : StatementGenerator if (dispatchReceiver != null) throw AssertionError("Dispatch receiver should be null: $dispatchReceiver") if (extensionReceiver != null) throw AssertionError("Extension receiver should be null: $extensionReceiver") val constructorSymbol = context.symbolTable.referenceConstructor(constructorDescriptor.original) - val irResultType = constructorDescriptor.returnType.toIrType() - val irCall = IrEnumConstructorCallImpl(startOffset, endOffset, irResultType, constructorSymbol) - addParametersToCall(startOffset, endOffset, call, irCall, irResultType) + val irCall = IrEnumConstructorCallImpl(startOffset, endOffset, context.irBuiltIns.unitType, constructorSymbol) + addParametersToCall(startOffset, endOffset, call, irCall, context.irBuiltIns.unitType) } } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/builders/ExpressionHelpers.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/builders/ExpressionHelpers.kt index a831d656efd..fa2ebbf1b3f 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/builders/ExpressionHelpers.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/builders/ExpressionHelpers.kt @@ -294,7 +294,7 @@ fun IrBuilderWithScope.irCall(callee: IrFunction, origin: IrStatementOrigin): Ir fun IrBuilderWithScope.irDelegatingConstructorCall(callee: IrConstructor): IrDelegatingConstructorCall = IrDelegatingConstructorCallImpl( - startOffset, endOffset, callee.returnType, callee.symbol, callee.descriptor, + startOffset, endOffset, context.irBuiltIns.unitType, callee.symbol, callee.descriptor, callee.parentAsClass.typeParameters.size, callee.valueParameters.size ) diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeepCopyTypeRemapper.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeepCopyTypeRemapper.kt index acfc6ac6d6d..aef160b9196 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeepCopyTypeRemapper.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeepCopyTypeRemapper.kt @@ -12,6 +12,7 @@ import org.jetbrains.kotlin.ir.types.IrType import org.jetbrains.kotlin.ir.types.IrTypeProjection import org.jetbrains.kotlin.ir.types.impl.IrSimpleTypeImpl import org.jetbrains.kotlin.ir.types.impl.IrTypeProjectionImpl +import org.jetbrains.kotlin.ir.types.impl.makeTypeProjection class DeepCopyTypeRemapper( private val symbolRemapper: SymbolRemapper @@ -33,7 +34,7 @@ class DeepCopyTypeRemapper( val arguments = type.arguments.map { if (it is IrTypeProjection) { - IrTypeProjectionImpl(this.remapType(it.type), it.variance) + makeTypeProjection(this.remapType(it.type), it.variance) } else { it }