[FIR] Change children order in FirConstructor

This commit is contained in:
Dmitriy Novozhilov
2019-11-15 14:23:34 +03:00
parent 01b47854c6
commit 99da7272f5
4 changed files with 6 additions and 5 deletions
@@ -31,13 +31,13 @@ interface FirConstructor : FirMemberFunction<FirConstructor> {
override val controlFlowGraphReference: FirControlFlowGraphReference
override val typeParameters: List<FirTypeParameter>
override val valueParameters: List<FirValueParameter>
override val body: FirBlock?
override val name: Name
override val status: FirDeclarationStatus
override val containerSource: DeserializedContainerSource?
override val annotations: List<FirAnnotationCall>
override val symbol: FirConstructorSymbol
val delegatedConstructor: FirDelegatedConstructorCall?
override val body: FirBlock?
val isPrimary: Boolean
override fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R = visitor.visitConstructor(this, data)
@@ -41,11 +41,11 @@ open class FirConstructorImpl(
override var controlFlowGraphReference: FirControlFlowGraphReference = FirEmptyControlFlowGraphReference()
override val typeParameters: MutableList<FirTypeParameter> = mutableListOf()
override val valueParameters: MutableList<FirValueParameter> = mutableListOf()
override var body: FirBlock? = null
override val name: Name = Name.special("<init>")
override var containerSource: DeserializedContainerSource? = null
override val annotations: MutableList<FirAnnotationCall> = mutableListOf()
override var delegatedConstructor: FirDelegatedConstructorCall? = null
override var body: FirBlock? = null
override val isPrimary: Boolean get() = false
init {
@@ -57,10 +57,10 @@ open class FirConstructorImpl(
receiverTypeRef?.accept(visitor, data)
controlFlowGraphReference.accept(visitor, data)
valueParameters.forEach { it.accept(visitor, data) }
body?.accept(visitor, data)
status.accept(visitor, data)
annotations.forEach { it.accept(visitor, data) }
delegatedConstructor?.accept(visitor, data)
body?.accept(visitor, data)
}
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirConstructorImpl {
@@ -68,10 +68,10 @@ open class FirConstructorImpl(
transformReceiverTypeRef(transformer, data)
transformControlFlowGraphReference(transformer, data)
transformValueParameters(transformer, data)
body = body?.transformSingle(transformer, data)
transformStatus(transformer, data)
annotations.transformInplace(transformer, data)
delegatedConstructor = delegatedConstructor?.transformSingle(transformer, data)
body = body?.transformSingle(transformer, data)
return this
}
@@ -39,13 +39,13 @@ abstract class FirModifiableConstructor : FirPureAbstractElement(), FirConstruct
abstract override var controlFlowGraphReference: FirControlFlowGraphReference
abstract override val typeParameters: MutableList<FirTypeParameter>
abstract override val valueParameters: MutableList<FirValueParameter>
abstract override var body: FirBlock?
abstract override val name: Name
abstract override var status: FirDeclarationStatus
abstract override var containerSource: DeserializedContainerSource?
abstract override val annotations: MutableList<FirAnnotationCall>
abstract override val symbol: FirConstructorSymbol
abstract override var delegatedConstructor: FirDelegatedConstructorCall?
abstract override var body: FirBlock?
abstract override val isPrimary: Boolean
abstract override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirModifiableConstructor
@@ -316,6 +316,7 @@ object NodeConfigurator : AbstractFieldConfigurator() {
parentArg(memberFunction, "F", constructor)
+symbol("FirConstructorSymbol")
+field("delegatedConstructor", delegatedConstructorCall, nullable = true)
+body(nullable = true)
+booleanField("isPrimary")
}