FIR. Refactor smart-cast representation in FIR tree

Make smart-casts non-transparent expression without delegation
to underlying FirQualifiedAccessExpression, as children delegation in
fir tree has unclear semantics
Remove two different kinds of tree nodes for smart-casts
This commit is contained in:
Simon Ogorodnik
2022-08-02 00:49:24 +02:00
committed by teamcity
parent bc9db58b3c
commit 513af2dfbc
154 changed files with 9573 additions and 9320 deletions
@@ -135,10 +135,14 @@ sealed class KtFakeSourceElementKind : KtSourceElementKind() {
// where componentN calls will have the fake source elements refer to the corresponding KtDestructuringDeclarationEntry
object DesugaredComponentFunctionCall : KtFakeSourceElementKind()
// when smart casts applied to the expression, its wrapped into FirExpressionWithSmartcast
// when smart casts applied to the expression, it is wrapped into FirSmartCastExpression
// which type reference will have a fake source refer to a original source element of it
object SmartCastedTypeRef : KtFakeSourceElementKind()
// when smart casts applied to the expression, it is wrapped into FirSmartCastExpression
// this kind used for such FirSmartCastExpressions itself
object SmartCastExpression : KtFakeSourceElementKind()
// for safe call expressions like a?.foo() the FirSafeCallExpression is generated
// and it have a fake source
object DesugaredSafeCallExpression : KtFakeSourceElementKind()