mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 23:39:07 +07:00
[kotlin] Migrate 'KtTypeParameterType' to 'KaTypeParameterType'
^KT-67996 GitOrigin-RevId: 1c1f5dff8c046820b77e749ab0ebf4888a08c9da
This commit is contained in:
committed by
intellij-monorepo-bot
parent
afca93078b
commit
0c8787db3b
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user