Analysis API: Use stub FirDataFlowAnalyzer when getting candidates.
This commit is contained in:
committed by
Ilya Kirillov
parent
3f3873dc50
commit
f1623347d8
@@ -322,11 +322,6 @@ private inline fun <T : FirExpression> BodyResolveComponents.transformExpression
|
||||
smartcastBuilder: () -> FirWrappedExpressionWithSmartcastBuilder<T>,
|
||||
smartcastToNullBuilder: () -> FirWrappedExpressionWithSmartcastToNullBuilder<T>
|
||||
): FirWrappedExpressionWithSmartcastBuilder<T>? {
|
||||
// No need to check for smartcast if the expression was already resolved.
|
||||
containingDeclarations.lastOrNull()?.let { closestDeclaration ->
|
||||
if (closestDeclaration.resolvePhase >= FirResolvePhase.BODY_RESOLVE) return null
|
||||
}
|
||||
|
||||
val (stability, typesFromSmartCast) = smartcastExtractor(expression) ?: return null
|
||||
val smartcastStability = stability.impliedSmartcastStability
|
||||
?: if (dataFlowAnalyzer.isAccessToUnstableLocalVariable(expression)) {
|
||||
|
||||
+1
-1
@@ -193,7 +193,7 @@ abstract class FirDataFlowAnalyzer<FLOW : Flow>(
|
||||
return getTypeUsingSmartcastInfo(symbol, qualifiedAccessExpression)
|
||||
}
|
||||
|
||||
private fun getTypeUsingSmartcastInfo(
|
||||
protected open fun getTypeUsingSmartcastInfo(
|
||||
symbol: FirBasedSymbol<*>,
|
||||
expression: FirExpression
|
||||
): Pair<PropertyStability, MutableList<ConeKotlinType>>? {
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ abstract class FirAbstractBodyResolveTransformer(phase: FirResolvePhase) : FirAb
|
||||
val ResolutionMode.expectedType: FirTypeRef?
|
||||
get() = expectedType(components)
|
||||
|
||||
class BodyResolveTransformerComponents(
|
||||
open class BodyResolveTransformerComponents(
|
||||
override val session: FirSession,
|
||||
override val scopeSession: ScopeSession,
|
||||
val transformer: FirBodyResolveTransformer,
|
||||
|
||||
Reference in New Issue
Block a user