FIR IDE: generate lazy initializers for properties

This commit is contained in:
Ilya Kirillov
2020-10-08 15:01:13 +03:00
parent 7c1170722f
commit 81d4371685
33 changed files with 106 additions and 41 deletions
@@ -368,7 +368,7 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
parentArg(callableDeclaration, "F", "F")
+name
+symbol("FirVariableSymbol", "F")
+initializer.withTransform()
+initializer.withTransform().withReplace()
+field("delegate", expression, nullable = true).withTransform()
+field("delegateFieldSymbol", delegateFieldSymbolType, "F", nullable = true)
generateBooleanFields("var", "val")
@@ -92,4 +92,8 @@ fun Field.withTransform(needTransformInOtherChildren: Boolean = false): Field =
this.needTransformInOtherChildren = needTransformInOtherChildren
}
fun Field.withReplace(): Field = copy().apply {
withReplace = true
}
fun FieldSet.withTransform(): FieldSet = this.map { it.withTransform() }