Fix type parameters in WrappedClassConstructorDescriptor
IrConstructorCall gets type parameters from the class in addition to the constructor declaration. This behavior is already implemented for ClassConstructorDescriptorImpl, but was not implemented for WrappedClassConstructorDescriptor, leading to missing type arguments for calls to constructors generated in a lowering pass.
This commit is contained in:
committed by
max-kammerer
parent
77c0e591af
commit
90c3269502
+4
-5
@@ -16,10 +16,7 @@ import org.jetbrains.kotlin.ir.descriptors.IrBasedDeclarationDescriptor
|
||||
import org.jetbrains.kotlin.ir.expressions.*
|
||||
import org.jetbrains.kotlin.ir.types.classifierOrFail
|
||||
import org.jetbrains.kotlin.ir.types.toKotlinType
|
||||
import org.jetbrains.kotlin.ir.util.defaultType
|
||||
import org.jetbrains.kotlin.ir.util.dump
|
||||
import org.jetbrains.kotlin.ir.util.isAnnotationClass
|
||||
import org.jetbrains.kotlin.ir.util.parentAsClass
|
||||
import org.jetbrains.kotlin.ir.util.*
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.constants.*
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.classId
|
||||
@@ -445,7 +442,9 @@ open class WrappedClassConstructorDescriptor(
|
||||
(containingDeclaration.containingDeclaration as ClassDescriptor).thisAsReceiverParameter
|
||||
}
|
||||
|
||||
override fun getTypeParameters() = owner.typeParameters.map { it.descriptor }
|
||||
override fun getTypeParameters() =
|
||||
(owner.constructedClass.typeParameters + owner.typeParameters).map { it.descriptor }
|
||||
|
||||
override fun getValueParameters() = owner.valueParameters.asSequence()
|
||||
.mapNotNull { it.descriptor as? ValueParameterDescriptor }
|
||||
.toMutableList()
|
||||
|
||||
Reference in New Issue
Block a user