[kotlin] Migrate 'KtTypeParameterType' to 'KaTypeParameterType'

^KT-67996

GitOrigin-RevId: 1c1f5dff8c046820b77e749ab0ebf4888a08c9da
This commit is contained in:
Yan Zhulanow
2024-06-24 01:42:02 +09:00
committed by intellij-monorepo-bot
parent afca93078b
commit 0c8787db3b
25 changed files with 52 additions and 52 deletions

View File

@@ -6,7 +6,7 @@ import org.jetbrains.kotlin.analysis.api.KtStarTypeProjection
import org.jetbrains.kotlin.analysis.api.symbols.KaClassSymbol
import org.jetbrains.kotlin.analysis.api.types.KtType
import org.jetbrains.kotlin.analysis.api.types.KaTypeNullability
import org.jetbrains.kotlin.analysis.api.types.KtTypeParameterType
import org.jetbrains.kotlin.analysis.api.types.KaTypeParameterType
/**
* Checks whether [this] is possibly a subtype of [superType] by replacing all type arguments in [superType] with star projections and
@@ -18,9 +18,9 @@ import org.jetbrains.kotlin.analysis.api.types.KtTypeParameterType
*/
context(KaSession)
infix fun KtType.isPossiblySubTypeOf(superType: KtType): Boolean {
if (this is KtTypeParameterType) return this.hasCommonSubTypeWith(superType)
if (this is KaTypeParameterType) return this.hasCommonSubTypeWith(superType)
if (superType is KtTypeParameterType) return superType.symbol.upperBounds.all { this isPossiblySubTypeOf it }
if (superType is KaTypeParameterType) return superType.symbol.upperBounds.all { this isPossiblySubTypeOf it }
val superTypeWithReplacedTypeArguments = superType.expandedSymbol?.let { symbol ->
buildClassTypeWithStarProjections(symbol, superType.nullability)