diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/IrBuiltInsOverFir.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/IrBuiltInsOverFir.kt index ecba08cc0c8..81dd8a751d4 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/IrBuiltInsOverFir.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/IrBuiltInsOverFir.kt @@ -537,13 +537,14 @@ class IrBuiltInsOverFir( val kotlinKt = kotlinIrPackage.createClass(kotlinPackage.child(Name.identifier("KotlinKt"))) KotlinPackageFuns( arrayOf = kotlinKt.addPackageFun("arrayOf", arrayClass.defaultType) arrayOf@{ - addTypeParameter("T", anyNType) + val typeParameter = addTypeParameter("T", anyNType) addValueParameter { this.name = Name.identifier("elements") - this.type = arrayClass.defaultType - this.varargElementType = typeParameters[0].defaultType + this.type = arrayClass.typeWithParameters(listOf(typeParameter)) + this.varargElementType = typeParameter.defaultType this.origin = this@arrayOf.origin } + returnType = arrayClass.typeWithParameters(listOf(typeParameter)) } ) }