diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyValueParameter.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyValueParameter.kt index f094fd53974..540fe49dc78 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyValueParameter.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyValueParameter.kt @@ -17,6 +17,7 @@ import org.jetbrains.kotlin.ir.types.IrType import org.jetbrains.kotlin.ir.util.DeclarationStubGenerator import org.jetbrains.kotlin.ir.util.TypeTranslator import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.types.KotlinType @OptIn(ObsoleteDescriptorBasedAPI::class) class IrLazyValueParameter( @@ -27,8 +28,8 @@ class IrLazyValueParameter( override val descriptor: ValueParameterDescriptor, override val name: Name, override val index: Int, - override var type: IrType, - override var varargElementType: IrType?, + kotlinType: KotlinType, + varargElementKotlinType: KotlinType?, override val isCrossinline: Boolean, override val isNoinline: Boolean, override val isHidden: Boolean, @@ -42,6 +43,14 @@ class IrLazyValueParameter( override var annotations: List by createLazyAnnotations() + override var type: IrType by lazyVar(stubGenerator.lock) { + kotlinType.toIrType() + } + + override var varargElementType: IrType? by lazyVar(stubGenerator.lock) { + varargElementKotlinType?.toIrType() + } + init { symbol.bind(this) } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeclarationStubGenerator.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeclarationStubGenerator.kt index 307cb0f5a66..4f22b67cffc 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeclarationStubGenerator.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeclarationStubGenerator.kt @@ -236,7 +236,7 @@ abstract class DeclarationStubGenerator( internal fun generateValueParameterStub(descriptor: ValueParameterDescriptor, index: Int): IrValueParameter = with(descriptor) { IrLazyValueParameter( UNDEFINED_OFFSET, UNDEFINED_OFFSET, computeOrigin(this), IrValueParameterSymbolImpl(this), this, name, index, - type.toIrType(), varargElementType?.toIrType(), + type, varargElementType, isCrossinline = isCrossinline, isNoinline = isNoinline, isHidden = false, isAssignable = false, stubGenerator = this@DeclarationStubGenerator, typeTranslator = typeTranslator ).also { irValueParameter ->