FIR: replace receiver in anon initializer with containing decl

This way the abstraction represents the intended use better and
doesn't stay on the way of using FirAnonymousInitializer in scripts
This commit is contained in:
Ilya Chernikov
2023-11-30 17:49:51 +01:00
committed by Space Team
parent 12da3d2b9f
commit ff4f30ddc1
13 changed files with 59 additions and 46 deletions
@@ -474,7 +474,11 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
anonymousInitializer.configure {
+body(nullable = true, withReplace = true)
+symbol("FirAnonymousInitializerSymbol")
+field("dispatchReceiverType", coneClassLikeTypeType, nullable = true)
// the containing declaration is nullable, because it is not immediately clear how to obtain it in all places in the fir builder
// TODO: review and consider making not-nullable (KT-64195)
+field("containingDeclarationSymbol", firBasedSymbolType.withArgs(TypeRef.Star), nullable = true).apply {
withBindThis = false
}
}
danglingModifierList.configure {