[FIR] Provide the correct type parameters when building arrayOf function
This commit is contained in:
committed by
Space Team
parent
88e244c1cf
commit
27adfa8370
@@ -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))
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user