[FIR] Merge FirPropertyFieldDeclarationSymbol into FirBackingFieldSymbol

This commit is contained in:
Nikolay Lunyak
2021-08-13 22:04:20 +03:00
committed by TeamCityServer
parent 1291f9e460
commit aefd6c30ad
32 changed files with 372 additions and 78 deletions
@@ -53,7 +53,7 @@ object FirTreeBuilder : AbstractFirTreeBuilder() {
val contractDescriptionOwner = sealedElement("ContractDescriptionOwner", Declaration)
val simpleFunction = element("SimpleFunction", Declaration, function, contractDescriptionOwner, typeParametersOwner)
val propertyAccessor = element("PropertyAccessor", Declaration, function, contractDescriptionOwner, typeParametersOwner)
val backingField = element("BackingField", Declaration, typedDeclaration, typeParametersOwner, statement)
val backingField = element("BackingField", Declaration, variable, typeParametersOwner, statement)
val constructor = element("Constructor", Declaration, function, typeParameterRefsOwner)
val file = element("File", Declaration, annotatedDeclaration)
val packageDirective = element("PackageDirective", Other)
@@ -199,7 +199,6 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator()
withGetter = true
}
default("backingFieldSymbol", "FirBackingFieldSymbol(symbol.callableId)")
useTypes(backingFieldSymbolType, delegateFieldSymbolType)
}
@@ -332,6 +331,10 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator()
kind = OpenClass
}
impl(backingField) {
kind = OpenClass
}
impl(whenSubjectExpression) {
default("typeRef") {
value = "whenRef.value.subject!!.typeRef"
@@ -315,7 +315,6 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
property.configure {
+symbol("FirPropertySymbol")
+field("backingFieldSymbol", backingFieldSymbolType)
+field("delegateFieldSymbol", delegateFieldSymbolType, nullable = true)
+booleanField("isLocal")
+field("bodyResolveState", propertyBodyResolveStateType, withReplace = true)
@@ -334,11 +333,8 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
}
backingField.configure {
+symbol("FirPropertyFieldDeclarationSymbol")
+field("backingFieldSymbol", backingFieldSymbolType, nullable = true).apply {
withBindThis = false
}
+field("propertySymbol", firPropertySymbolType, nullable = true).apply {
+field("symbol", backingFieldSymbolType)
+field("propertySymbol", firPropertySymbolType).apply {
withBindThis = false
}
+initializer.withTransform().withReplace()