FIR DFA: slightly refactor smart cast state tracking

Instead of always looking up smart casts on `lastNode` and separately
tracking the receiver state, simply track which flow the smart casts
belong to right now. This tracked flow is auto-advanced when new
`lastNode`s are created, but can be manually rolled back for things like
KT-63709.
This commit is contained in:
Sonya Valchuk
2024-02-16 11:25:22 +00:00
committed by Space Cloud
parent 052baf1b04
commit 4c8febf10d
5 changed files with 39 additions and 50 deletions
@@ -58,10 +58,7 @@ internal open class StubBodyResolveTransformerComponents(
override fun receiverUpdated(symbol: FirBasedSymbol<*>, info: TypeStatement?) =
error("Should not be called")
override fun getTypeUsingSmartcastInfo(
expression: FirExpression,
ignoreCallArguments: Boolean,
): Pair<PropertyStability, MutableList<ConeKotlinType>>? =
override fun getTypeUsingSmartcastInfo(expression: FirExpression): Pair<PropertyStability, MutableList<ConeKotlinType>>? =
null
}
}