KT-13822 Exception in the compiler for start-projection of a type alias

Use ClassifierWithTypeParameters in StarProjectionImpl.
This commit is contained in:
Dmitry Petrov
2016-09-13 10:20:55 +03:00
parent 5b047684ab
commit dae4521c68
4 changed files with 32 additions and 1 deletions
@@ -17,6 +17,7 @@
package org.jetbrains.kotlin.types
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.ClassifierDescriptorWithTypeParameters
import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor
import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns
@@ -36,7 +37,7 @@ class StarProjectionImpl(
}
fun TypeParameterDescriptor.starProjectionType(): KotlinType {
val classDescriptor = this.containingDeclaration as ClassDescriptor
val classDescriptor = this.containingDeclaration as ClassifierDescriptorWithTypeParameters
val typeParameters = classDescriptor.typeConstructor.parameters.map { it.typeConstructor }
return TypeSubstitutor.create(
object : TypeConstructorSubstitution() {