[FIR IDE] Make KtSmartcastProvider report resolved smartcast type
This commit is contained in:
committed by
Ilya Kirillov
parent
d97a2b13c0
commit
58d903c638
+1
-1
@@ -7,7 +7,7 @@ package org.jetbrains.kotlin.idea.frontend.api
|
||||
|
||||
import org.jetbrains.kotlin.idea.frontend.api.types.KtType
|
||||
|
||||
data class ImplicitReceiverSmartCast(val types: Collection<KtType>, val kind: ImplicitReceiverSmartcastKind)
|
||||
data class ImplicitReceiverSmartCast(val type: KtType, val kind: ImplicitReceiverSmartcastKind)
|
||||
|
||||
enum class ImplicitReceiverSmartcastKind {
|
||||
DISPATCH, EXTENSION
|
||||
|
||||
+3
-3
@@ -61,10 +61,10 @@ abstract class KtAnalysisSession(final override val token: ValidityToken) : Vali
|
||||
fun KtCallableSymbol.getIntersectionOverriddenSymbols(): Collection<KtCallableSymbol> =
|
||||
symbolDeclarationOverridesProvider.getIntersectionOverriddenSymbols(this)
|
||||
|
||||
fun KtExpression.getSmartCasts(): Collection<KtType> = smartCastProvider.getSmartCastedToTypes(this)
|
||||
fun KtExpression.getSmartCast(): KtType? = smartCastProvider.getSmartCastedToType(this)
|
||||
|
||||
fun KtExpression.getImplicitReceiverSmartCasts(): Collection<ImplicitReceiverSmartCast> =
|
||||
smartCastProvider.getImplicitReceiverSmartCasts(this)
|
||||
fun KtExpression.getImplicitReceiverSmartCast(): Collection<ImplicitReceiverSmartCast> =
|
||||
smartCastProvider.getImplicitReceiverSmartCast(this)
|
||||
|
||||
fun KtExpression.getKtType(): KtType = expressionTypeProvider.getKtExpressionType(this)
|
||||
|
||||
|
||||
+2
-2
@@ -10,6 +10,6 @@ import org.jetbrains.kotlin.idea.frontend.api.types.KtType
|
||||
import org.jetbrains.kotlin.psi.KtExpression
|
||||
|
||||
abstract class KtSmartCastProvider : KtAnalysisSessionComponent() {
|
||||
abstract fun getSmartCastedToTypes(expression: KtExpression): Collection<KtType>
|
||||
abstract fun getImplicitReceiverSmartCasts(expression: KtExpression): Collection<ImplicitReceiverSmartCast>
|
||||
abstract fun getSmartCastedToType(expression: KtExpression): KtType?
|
||||
abstract fun getImplicitReceiverSmartCast(expression: KtExpression): Collection<ImplicitReceiverSmartCast>
|
||||
}
|
||||
Reference in New Issue
Block a user