[AA LC] Expand aliases of type arguments during conversion to KtType
^KT-55781
This commit is contained in:
committed by
Space Team
parent
36ae901b19
commit
ed867af01d
@@ -61,8 +61,26 @@ val ConeTypeProjection.type: ConeKotlinType?
|
||||
get() = when (this) {
|
||||
ConeStarProjection -> null
|
||||
is ConeKotlinTypeProjection -> type
|
||||
is ConeKotlinType -> this
|
||||
}
|
||||
|
||||
val ConeTypeProjection.isStarProjection: Boolean
|
||||
get() = this == ConeStarProjection
|
||||
|
||||
fun ConeTypeProjection.replaceType(newType: ConeKotlinType?): ConeTypeProjection {
|
||||
return when (this) {
|
||||
is ConeStarProjection -> this
|
||||
is ConeKotlinTypeProjection -> {
|
||||
requireNotNull(newType) { "Type for non star projection should be not null" }
|
||||
replaceType(newType)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun ConeKotlinTypeProjection.replaceType(newType: ConeKotlinType): ConeKotlinTypeProjection {
|
||||
return when (this) {
|
||||
is ConeKotlinType -> newType
|
||||
is ConeKotlinTypeProjectionIn -> ConeKotlinTypeProjectionIn(newType)
|
||||
is ConeKotlinTypeProjectionOut -> ConeKotlinTypeProjectionOut(newType)
|
||||
is ConeKotlinTypeConflictingProjection -> ConeKotlinTypeConflictingProjection(newType)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user