KT-14400: Properly handle TypeAliasConstructorDescriptor in KotlinTypeMapper.mapToCallableMethod(...)
Implement getDefaultType() in TypeAliasDescriptor subclasses.
This commit is contained in:
+2
@@ -133,6 +133,8 @@ class NotFoundClasses(private val storageManager: StorageManager, private val mo
|
||||
get() = builtIns.nullableAnyType
|
||||
override val expandedType: SimpleType
|
||||
get() = builtIns.nullableAnyType
|
||||
override fun getDefaultType(): SimpleType =
|
||||
builtIns.nullableAnyType
|
||||
|
||||
override fun substitute(substitutor: TypeSubstitutor) = this
|
||||
|
||||
|
||||
+5
@@ -155,6 +155,7 @@ class DeserializedTypeAliasDescriptor(
|
||||
override lateinit var underlyingType: SimpleType private set
|
||||
override lateinit var expandedType: SimpleType private set
|
||||
private lateinit var typeConstructorParameters: List<TypeParameterDescriptor>
|
||||
private lateinit var defaultTypeImpl: SimpleType private set
|
||||
|
||||
fun initialize(
|
||||
declaredTypeParameters: List<TypeParameterDescriptor>,
|
||||
@@ -165,8 +166,12 @@ class DeserializedTypeAliasDescriptor(
|
||||
this.underlyingType = underlyingType
|
||||
this.expandedType = expandedType
|
||||
typeConstructorParameters = computeConstructorTypeParameters()
|
||||
defaultTypeImpl = computeDefaultType()
|
||||
}
|
||||
|
||||
override fun getDefaultType(): SimpleType =
|
||||
defaultTypeImpl
|
||||
|
||||
override fun substitute(substitutor: TypeSubstitutor): TypeAliasDescriptor {
|
||||
if (substitutor.isEmpty) return this
|
||||
val substituted = DeserializedTypeAliasDescriptor(containingDeclaration, annotations, name, visibility, proto, nameResolver, typeTable, containerSource)
|
||||
|
||||
Reference in New Issue
Block a user