diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaClass.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaClass.kt index 5e2b785337b..d3d4da310ff 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaClass.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaClass.kt @@ -80,7 +80,7 @@ class FirJavaClass @FirImplementationDetail internal constructor( } override fun transformChildren(transformer: FirTransformer, data: D): FirJavaClass { - typeParameters.transformInplace(transformer, data) + transformTypeParameters(transformer, data) transformDeclarations(transformer, data) status = status.transformSingle(transformer, data) transformSuperTypeRefs(transformer, data) @@ -115,6 +115,11 @@ class FirJavaClass @FirImplementationDetail internal constructor( override fun transformCompanionObject(transformer: FirTransformer, data: D): FirJavaClass { return this } + + override fun transformTypeParameters(transformer: FirTransformer, data: D): FirRegularClass { + typeParameters.transformInplace(transformer, data) + return this + } } @FirBuilderDsl diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaConstructor.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaConstructor.kt index f47570f8d94..70a6e5405a5 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaConstructor.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaConstructor.kt @@ -88,7 +88,7 @@ class FirJavaConstructor @FirImplementationDetail constructor( override fun transformChildren(transformer: FirTransformer, data: D): FirJavaConstructor { transformReturnTypeRef(transformer, data) transformControlFlowGraphReference(transformer, data) - typeParameters.transformInplace(transformer, data) + transformTypeParameters(transformer, data) transformValueParameters(transformer, data) status = status.transformSingle(transformer, data) transformAnnotations(transformer, data) @@ -117,6 +117,11 @@ class FirJavaConstructor @FirImplementationDetail constructor( return this } + override fun transformTypeParameters(transformer: FirTransformer, data: D): FirJavaConstructor { + typeParameters.transformInplace(transformer, data) + return this + } + override var containerSource: DeserializedContainerSource? = null override fun replaceReturnTypeRef(newReturnTypeRef: FirTypeRef) { diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaField.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaField.kt index cf172624fe1..df6d7e363c9 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaField.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaField.kt @@ -72,7 +72,6 @@ class FirJavaField @FirImplementationDetail constructor( override fun transformOtherChildren(transformer: FirTransformer, data: D): FirField { transformAnnotations(transformer, data) - typeParameters.transformInplace(transformer, data) return this } @@ -92,6 +91,7 @@ class FirJavaField @FirImplementationDetail constructor( override fun transformChildren(transformer: FirTransformer, data: D): FirJavaField { transformReturnTypeRef(transformer, data) + transformTypeParameters(transformer, data) transformOtherChildren(transformer, data) return this } @@ -110,6 +110,11 @@ class FirJavaField @FirImplementationDetail constructor( return this } + override fun transformTypeParameters(transformer: FirTransformer, data: D): FirField { + typeParameters.transformInplace(transformer, data) + return this + } + override val delegate: FirExpression? get() = null diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt index 56fd94fc213..877bd91d8ef 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt @@ -224,7 +224,8 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor if (property.delegateFieldSymbol != null) { replacePropertyReferenceTypeInDelegateAccessors(property) } - property.transformOtherChildren(transformer, ResolutionMode.ContextIndependent) + property.transformTypeParameters(transformer, ResolutionMode.ContextIndependent) + .transformOtherChildren(transformer, ResolutionMode.ContextIndependent) } override fun transformWrappedDelegateExpression( @@ -259,6 +260,7 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor val resolutionMode = withExpectedType(variable.returnTypeRef) variable.transformInitializer(transformer, resolutionMode) .transformDelegate(transformer, resolutionMode) + .transformTypeParameters(transformer, resolutionMode) .transformOtherChildren(transformer, resolutionMode) .transformInitializer(integerLiteralTypeApproximator, null) if (variable.initializer != null) { @@ -277,6 +279,7 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor return transformReturnTypeRef(transformer, data) .transformInitializer(transformer, data) .transformDelegate(transformer, data) + .transformTypeParameters(transformer, data) .transformOtherChildren(transformer, data) } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirAnonymousFunction.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirAnonymousFunction.kt index 02844d40038..071317d5395 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirAnonymousFunction.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirAnonymousFunction.kt @@ -66,4 +66,6 @@ abstract class FirAnonymousFunction : FirFunction, FirExpr abstract override fun transformValueParameters(transformer: FirTransformer, data: D): FirAnonymousFunction abstract override fun transformBody(transformer: FirTransformer, data: D): FirAnonymousFunction + + abstract override fun transformTypeParameters(transformer: FirTransformer, data: D): FirAnonymousFunction } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirAnonymousObject.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirAnonymousObject.kt index b1376d45022..66ef3e03fbc 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirAnonymousObject.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirAnonymousObject.kt @@ -45,6 +45,8 @@ abstract class FirAnonymousObject : FirClass, FirControlFlow abstract override fun replaceTypeRef(newTypeRef: FirTypeRef) + abstract override fun transformTypeParameters(transformer: FirTransformer, data: D): FirAnonymousObject + abstract override fun transformSuperTypeRefs(transformer: FirTransformer, data: D): FirAnonymousObject abstract override fun transformDeclarations(transformer: FirTransformer, data: D): FirAnonymousObject diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirCallableMemberDeclaration.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirCallableMemberDeclaration.kt index 58c45b5f162..c1dc9ebb7c9 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirCallableMemberDeclaration.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirCallableMemberDeclaration.kt @@ -46,5 +46,7 @@ interface FirCallableMemberDeclaration> : Fi override fun transformReceiverTypeRef(transformer: FirTransformer, data: D): FirCallableMemberDeclaration + override fun transformTypeParameters(transformer: FirTransformer, data: D): FirCallableMemberDeclaration + override fun transformStatus(transformer: FirTransformer, data: D): FirCallableMemberDeclaration } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirClass.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirClass.kt index ac7384be0e3..f57cc2d43d1 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirClass.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirClass.kt @@ -40,6 +40,8 @@ interface FirClass> : FirClassLikeDeclaration, FirStatement, fun replaceSuperTypeRefs(newSuperTypeRefs: List) + override fun transformTypeParameters(transformer: FirTransformer, data: D): FirClass + fun transformSuperTypeRefs(transformer: FirTransformer, data: D): FirClass fun transformDeclarations(transformer: FirTransformer, data: D): FirClass diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirConstructor.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirConstructor.kt index 080e555a182..3467e18e239 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirConstructor.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirConstructor.kt @@ -55,6 +55,8 @@ abstract class FirConstructor : FirPureAbstractElement(), FirFunction transformReceiverTypeRef(transformer: FirTransformer, data: D): FirConstructor + abstract override fun transformTypeParameters(transformer: FirTransformer, data: D): FirConstructor + abstract override fun transformControlFlowGraphReference(transformer: FirTransformer, data: D): FirConstructor abstract override fun transformValueParameters(transformer: FirTransformer, data: D): FirConstructor diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirEnumEntry.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirEnumEntry.kt index aa54d4737ab..5016310348f 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirEnumEntry.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirEnumEntry.kt @@ -65,6 +65,8 @@ abstract class FirEnumEntry : FirVariable(), FirCallableMemberDecl abstract override fun transformAnnotations(transformer: FirTransformer, data: D): FirEnumEntry + abstract override fun transformTypeParameters(transformer: FirTransformer, data: D): FirEnumEntry + abstract override fun transformStatus(transformer: FirTransformer, data: D): FirEnumEntry abstract override fun transformOtherChildren(transformer: FirTransformer, data: D): FirEnumEntry diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirErrorFunction.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirErrorFunction.kt index 394ff910aaa..9cd332a5a11 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirErrorFunction.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirErrorFunction.kt @@ -59,4 +59,6 @@ abstract class FirErrorFunction : FirPureAbstractElement(), FirFunction transformValueParameters(transformer: FirTransformer, data: D): FirErrorFunction abstract override fun transformBody(transformer: FirTransformer, data: D): FirErrorFunction + + abstract override fun transformTypeParameters(transformer: FirTransformer, data: D): FirErrorFunction } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirErrorProperty.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirErrorProperty.kt index 4f0113e4052..b24fbf28a95 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirErrorProperty.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirErrorProperty.kt @@ -65,5 +65,7 @@ abstract class FirErrorProperty : FirVariable(), FirDiagnostic abstract override fun transformAnnotations(transformer: FirTransformer, data: D): FirErrorProperty + abstract override fun transformTypeParameters(transformer: FirTransformer, data: D): FirErrorProperty + abstract override fun transformOtherChildren(transformer: FirTransformer, data: D): FirErrorProperty } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirField.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirField.kt index 96ddc6a09b7..24c5705a8bb 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirField.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirField.kt @@ -65,6 +65,8 @@ abstract class FirField : FirVariable(), FirTypeParametersOwner, FirCa abstract override fun transformAnnotations(transformer: FirTransformer, data: D): FirField + abstract override fun transformTypeParameters(transformer: FirTransformer, data: D): FirField + abstract override fun transformStatus(transformer: FirTransformer, data: D): FirField abstract override fun transformOtherChildren(transformer: FirTransformer, data: D): FirField diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirFunction.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirFunction.kt index 12d3bb23f5c..f7214e1ee35 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirFunction.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirFunction.kt @@ -52,6 +52,8 @@ interface FirFunction> : FirCallableDeclaration, FirTarget override fun transformReceiverTypeRef(transformer: FirTransformer, data: D): FirFunction + override fun transformTypeParameters(transformer: FirTransformer, data: D): FirFunction + override fun transformControlFlowGraphReference(transformer: FirTransformer, data: D): FirFunction fun transformValueParameters(transformer: FirTransformer, data: D): FirFunction diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirMemberDeclaration.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirMemberDeclaration.kt index bffe2ffcde2..ec888870475 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirMemberDeclaration.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirMemberDeclaration.kt @@ -15,14 +15,14 @@ import org.jetbrains.kotlin.fir.visitors.* * DO NOT MODIFY IT MANUALLY */ -interface FirMemberDeclaration : FirAnnotatedDeclaration { +interface FirMemberDeclaration : FirAnnotatedDeclaration, FirTypeParameterRefsOwner { override val source: FirSourceElement? override val session: FirSession override val resolvePhase: FirResolvePhase override val origin: FirDeclarationOrigin override val attributes: FirDeclarationAttributes override val annotations: List - val typeParameters: List + override val typeParameters: List val status: FirDeclarationStatus override fun accept(visitor: FirVisitor, data: D): R = visitor.visitMemberDeclaration(this, data) @@ -31,5 +31,7 @@ interface FirMemberDeclaration : FirAnnotatedDeclaration { override fun transformAnnotations(transformer: FirTransformer, data: D): FirMemberDeclaration + override fun transformTypeParameters(transformer: FirTransformer, data: D): FirMemberDeclaration + fun transformStatus(transformer: FirTransformer, data: D): FirMemberDeclaration } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirProperty.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirProperty.kt index 4fb4c599414..0a78b4077f3 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirProperty.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirProperty.kt @@ -40,12 +40,12 @@ abstract class FirProperty : FirVariable(), FirTypeParametersOwner, abstract override val getter: FirPropertyAccessor? abstract override val setter: FirPropertyAccessor? abstract override val annotations: List + abstract override val typeParameters: List abstract override val controlFlowGraphReference: FirControlFlowGraphReference abstract override val containerSource: DeserializedContainerSource? abstract override val symbol: FirPropertySymbol abstract val backingFieldSymbol: FirBackingFieldSymbol abstract val isLocal: Boolean - abstract override val typeParameters: List abstract override val status: FirDeclarationStatus override fun accept(visitor: FirVisitor, data: D): R = visitor.visitProperty(this, data) @@ -70,6 +70,8 @@ abstract class FirProperty : FirVariable(), FirTypeParametersOwner, abstract override fun transformAnnotations(transformer: FirTransformer, data: D): FirProperty + abstract override fun transformTypeParameters(transformer: FirTransformer, data: D): FirProperty + abstract override fun transformControlFlowGraphReference(transformer: FirTransformer, data: D): FirProperty abstract override fun transformStatus(transformer: FirTransformer, data: D): FirProperty diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirPropertyAccessor.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirPropertyAccessor.kt index f67068795ff..0cafb8d0a42 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirPropertyAccessor.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirPropertyAccessor.kt @@ -67,4 +67,6 @@ abstract class FirPropertyAccessor : FirPureAbstractElement(), FirFunction transformStatus(transformer: FirTransformer, data: D): FirPropertyAccessor abstract override fun transformAnnotations(transformer: FirTransformer, data: D): FirPropertyAccessor + + abstract override fun transformTypeParameters(transformer: FirTransformer, data: D): FirPropertyAccessor } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirRegularClass.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirRegularClass.kt index a64d76e38eb..5d9faff37ea 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirRegularClass.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirRegularClass.kt @@ -49,6 +49,8 @@ abstract class FirRegularClass : FirPureAbstractElement(), FirMemberDeclaration, abstract override fun transformAnnotations(transformer: FirTransformer, data: D): FirRegularClass + abstract override fun transformTypeParameters(transformer: FirTransformer, data: D): FirRegularClass + abstract override fun transformStatus(transformer: FirTransformer, data: D): FirRegularClass abstract override fun transformControlFlowGraphReference(transformer: FirTransformer, data: D): FirRegularClass diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirSimpleFunction.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirSimpleFunction.kt index da62556704a..5455131edff 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirSimpleFunction.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirSimpleFunction.kt @@ -69,4 +69,6 @@ abstract class FirSimpleFunction : FirPureAbstractElement(), FirFunction transformContractDescription(transformer: FirTransformer, data: D): FirSimpleFunction abstract override fun transformAnnotations(transformer: FirTransformer, data: D): FirSimpleFunction + + abstract override fun transformTypeParameters(transformer: FirTransformer, data: D): FirSimpleFunction } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypeAlias.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypeAlias.kt index a4684805ada..2a2cbce0619 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypeAlias.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypeAlias.kt @@ -40,5 +40,7 @@ abstract class FirTypeAlias : FirPureAbstractElement(), FirClassLikeDeclaration< abstract override fun transformStatus(transformer: FirTransformer, data: D): FirTypeAlias + abstract override fun transformTypeParameters(transformer: FirTransformer, data: D): FirTypeAlias + abstract override fun transformAnnotations(transformer: FirTransformer, data: D): FirTypeAlias } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypeParameterRefsOwner.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypeParameterRefsOwner.kt index c50a2722783..0cacd6d97fb 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypeParameterRefsOwner.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypeParameterRefsOwner.kt @@ -19,4 +19,6 @@ interface FirTypeParameterRefsOwner : FirElement { val typeParameters: List override fun accept(visitor: FirVisitor, data: D): R = visitor.visitTypeParameterRefsOwner(this, data) + + fun transformTypeParameters(transformer: FirTransformer, data: D): FirTypeParameterRefsOwner } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypeParametersOwner.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypeParametersOwner.kt index b931c48697e..940f6dbc999 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypeParametersOwner.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypeParametersOwner.kt @@ -18,4 +18,6 @@ interface FirTypeParametersOwner : FirTypeParameterRefsOwner { override val typeParameters: List override fun accept(visitor: FirVisitor, data: D): R = visitor.visitTypeParametersOwner(this, data) + + override fun transformTypeParameters(transformer: FirTransformer, data: D): FirTypeParametersOwner } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/builder/FirPropertyBuilder.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/builder/FirPropertyBuilder.kt index 74e2580d054..54ef5fe6975 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/builder/FirPropertyBuilder.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/builder/FirPropertyBuilder.kt @@ -52,10 +52,10 @@ class FirPropertyBuilder : FirTypeParametersOwnerBuilder, FirAnnotationContainer var getter: FirPropertyAccessor? = null var setter: FirPropertyAccessor? = null override val annotations: MutableList = mutableListOf() + override val typeParameters: MutableList = mutableListOf() var containerSource: DeserializedContainerSource? = null lateinit var symbol: FirPropertySymbol var isLocal: Boolean by kotlin.properties.Delegates.notNull() - override val typeParameters: MutableList = mutableListOf() lateinit var status: FirDeclarationStatus override fun build(): FirProperty { @@ -74,10 +74,10 @@ class FirPropertyBuilder : FirTypeParametersOwnerBuilder, FirAnnotationContainer getter, setter, annotations, + typeParameters, containerSource, symbol, isLocal, - typeParameters, status, ) } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirAnonymousFunctionImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirAnonymousFunctionImpl.kt index a30e73ab89b..feb0583490c 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirAnonymousFunctionImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirAnonymousFunctionImpl.kt @@ -72,7 +72,7 @@ internal class FirAnonymousFunctionImpl( transformBody(transformer, data) typeRef = typeRef.transformSingle(transformer, data) label = label?.transformSingle(transformer, data) - typeParameters.transformInplace(transformer, data) + transformTypeParameters(transformer, data) return this } @@ -106,6 +106,11 @@ internal class FirAnonymousFunctionImpl( return this } + override fun transformTypeParameters(transformer: FirTransformer, data: D): FirAnonymousFunctionImpl { + typeParameters.transformInplace(transformer, data) + return this + } + override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) { resolvePhase = newResolvePhase } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirAnonymousObjectImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirAnonymousObjectImpl.kt index fbbfec431bd..ee94c01f636 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirAnonymousObjectImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirAnonymousObjectImpl.kt @@ -58,7 +58,7 @@ internal class FirAnonymousObjectImpl( } override fun transformChildren(transformer: FirTransformer, data: D): FirAnonymousObjectImpl { - typeParameters.transformInplace(transformer, data) + transformTypeParameters(transformer, data) transformSuperTypeRefs(transformer, data) transformDeclarations(transformer, data) transformAnnotations(transformer, data) @@ -67,6 +67,11 @@ internal class FirAnonymousObjectImpl( return this } + override fun transformTypeParameters(transformer: FirTransformer, data: D): FirAnonymousObjectImpl { + typeParameters.transformInplace(transformer, data) + return this + } + override fun transformSuperTypeRefs(transformer: FirTransformer, data: D): FirAnonymousObjectImpl { superTypeRefs.transformInplace(transformer, data) return this diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirConstructorImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirConstructorImpl.kt index cc48afa2c45..1165e7b83e7 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirConstructorImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirConstructorImpl.kt @@ -68,7 +68,7 @@ internal class FirConstructorImpl( override fun transformChildren(transformer: FirTransformer, data: D): FirConstructorImpl { transformReturnTypeRef(transformer, data) transformReceiverTypeRef(transformer, data) - typeParameters.transformInplace(transformer, data) + transformTypeParameters(transformer, data) transformControlFlowGraphReference(transformer, data) transformValueParameters(transformer, data) transformStatus(transformer, data) @@ -88,6 +88,11 @@ internal class FirConstructorImpl( return this } + override fun transformTypeParameters(transformer: FirTransformer, data: D): FirConstructorImpl { + typeParameters.transformInplace(transformer, data) + return this + } + override fun transformControlFlowGraphReference(transformer: FirTransformer, data: D): FirConstructorImpl { controlFlowGraphReference = controlFlowGraphReference.transformSingle(transformer, data) return this diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirEnumEntryImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirEnumEntryImpl.kt index 73804a3e9bd..e654fc45a53 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirEnumEntryImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirEnumEntryImpl.kt @@ -67,6 +67,7 @@ internal class FirEnumEntryImpl( override fun transformChildren(transformer: FirTransformer, data: D): FirEnumEntryImpl { transformReturnTypeRef(transformer, data) transformInitializer(transformer, data) + transformTypeParameters(transformer, data) transformStatus(transformer, data) transformOtherChildren(transformer, data) return this @@ -103,6 +104,11 @@ internal class FirEnumEntryImpl( return this } + override fun transformTypeParameters(transformer: FirTransformer, data: D): FirEnumEntryImpl { + typeParameters.transformInplace(transformer, data) + return this + } + override fun transformStatus(transformer: FirTransformer, data: D): FirEnumEntryImpl { status = status.transformSingle(transformer, data) return this @@ -110,7 +116,6 @@ internal class FirEnumEntryImpl( override fun transformOtherChildren(transformer: FirTransformer, data: D): FirEnumEntryImpl { transformAnnotations(transformer, data) - typeParameters.transformInplace(transformer, data) return this } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirErrorFunctionImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirErrorFunctionImpl.kt index 0969ee4b728..af3c52eac30 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirErrorFunctionImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirErrorFunctionImpl.kt @@ -62,7 +62,7 @@ internal class FirErrorFunctionImpl( transformReturnTypeRef(transformer, data) transformControlFlowGraphReference(transformer, data) transformValueParameters(transformer, data) - typeParameters.transformInplace(transformer, data) + transformTypeParameters(transformer, data) return this } @@ -94,6 +94,11 @@ internal class FirErrorFunctionImpl( return this } + override fun transformTypeParameters(transformer: FirTransformer, data: D): FirErrorFunctionImpl { + typeParameters.transformInplace(transformer, data) + return this + } + override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) { resolvePhase = newResolvePhase } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirErrorPropertyImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirErrorPropertyImpl.kt index 7cb41fa6582..262df618bb2 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirErrorPropertyImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirErrorPropertyImpl.kt @@ -63,6 +63,7 @@ internal class FirErrorPropertyImpl( override fun transformChildren(transformer: FirTransformer, data: D): FirErrorPropertyImpl { transformReturnTypeRef(transformer, data) + transformTypeParameters(transformer, data) transformOtherChildren(transformer, data) return this } @@ -97,9 +98,13 @@ internal class FirErrorPropertyImpl( return this } + override fun transformTypeParameters(transformer: FirTransformer, data: D): FirErrorPropertyImpl { + typeParameters.transformInplace(transformer, data) + return this + } + override fun transformOtherChildren(transformer: FirTransformer, data: D): FirErrorPropertyImpl { transformAnnotations(transformer, data) - typeParameters.transformInplace(transformer, data) return this } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirFieldImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirFieldImpl.kt index 10d22843b75..7cb4c4030fd 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirFieldImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirFieldImpl.kt @@ -65,6 +65,7 @@ internal class FirFieldImpl( override fun transformChildren(transformer: FirTransformer, data: D): FirFieldImpl { transformReturnTypeRef(transformer, data) + transformTypeParameters(transformer, data) transformStatus(transformer, data) transformOtherChildren(transformer, data) return this @@ -100,6 +101,11 @@ internal class FirFieldImpl( return this } + override fun transformTypeParameters(transformer: FirTransformer, data: D): FirFieldImpl { + typeParameters.transformInplace(transformer, data) + return this + } + override fun transformStatus(transformer: FirTransformer, data: D): FirFieldImpl { status = status.transformSingle(transformer, data) return this @@ -107,7 +113,6 @@ internal class FirFieldImpl( override fun transformOtherChildren(transformer: FirTransformer, data: D): FirFieldImpl { transformAnnotations(transformer, data) - typeParameters.transformInplace(transformer, data) return this } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirPrimaryConstructor.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirPrimaryConstructor.kt index 4ae96602182..995ea1621fa 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirPrimaryConstructor.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirPrimaryConstructor.kt @@ -68,7 +68,7 @@ internal class FirPrimaryConstructor( override fun transformChildren(transformer: FirTransformer, data: D): FirPrimaryConstructor { transformReturnTypeRef(transformer, data) transformReceiverTypeRef(transformer, data) - typeParameters.transformInplace(transformer, data) + transformTypeParameters(transformer, data) transformControlFlowGraphReference(transformer, data) transformValueParameters(transformer, data) transformStatus(transformer, data) @@ -88,6 +88,11 @@ internal class FirPrimaryConstructor( return this } + override fun transformTypeParameters(transformer: FirTransformer, data: D): FirPrimaryConstructor { + typeParameters.transformInplace(transformer, data) + return this + } + override fun transformControlFlowGraphReference(transformer: FirTransformer, data: D): FirPrimaryConstructor { controlFlowGraphReference = controlFlowGraphReference.transformSingle(transformer, data) return this diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirPropertyAccessorImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirPropertyAccessorImpl.kt index 1a341b8eda7..a93115c2f2f 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirPropertyAccessorImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirPropertyAccessorImpl.kt @@ -73,7 +73,7 @@ open class FirPropertyAccessorImpl @FirImplementationDetail constructor( transformContractDescription(transformer, data) transformStatus(transformer, data) transformAnnotations(transformer, data) - typeParameters.transformInplace(transformer, data) + transformTypeParameters(transformer, data) return this } @@ -116,6 +116,11 @@ open class FirPropertyAccessorImpl @FirImplementationDetail constructor( return this } + override fun transformTypeParameters(transformer: FirTransformer, data: D): FirPropertyAccessorImpl { + typeParameters.transformInplace(transformer, data) + return this + } + override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) { resolvePhase = newResolvePhase } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirPropertyImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirPropertyImpl.kt index 1f6bbf6b659..d68b685a07a 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirPropertyImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirPropertyImpl.kt @@ -46,10 +46,10 @@ internal class FirPropertyImpl( override var getter: FirPropertyAccessor?, override var setter: FirPropertyAccessor?, override val annotations: MutableList, + override val typeParameters: MutableList, override val containerSource: DeserializedContainerSource?, override val symbol: FirPropertySymbol, override val isLocal: Boolean, - override val typeParameters: MutableList, override var status: FirDeclarationStatus, ) : FirProperty() { override val attributes: FirDeclarationAttributes = FirDeclarationAttributes() @@ -71,8 +71,8 @@ internal class FirPropertyImpl( getter?.accept(visitor, data) setter?.accept(visitor, data) annotations.forEach { it.accept(visitor, data) } - controlFlowGraphReference.accept(visitor, data) typeParameters.forEach { it.accept(visitor, data) } + controlFlowGraphReference.accept(visitor, data) status.accept(visitor, data) } @@ -83,6 +83,7 @@ internal class FirPropertyImpl( transformDelegate(transformer, data) transformGetter(transformer, data) transformSetter(transformer, data) + transformTypeParameters(transformer, data) transformControlFlowGraphReference(transformer, data) transformStatus(transformer, data) transformOtherChildren(transformer, data) @@ -124,6 +125,11 @@ internal class FirPropertyImpl( return this } + override fun transformTypeParameters(transformer: FirTransformer, data: D): FirPropertyImpl { + typeParameters.transformInplace(transformer, data) + return this + } + override fun transformControlFlowGraphReference(transformer: FirTransformer, data: D): FirPropertyImpl { controlFlowGraphReference = controlFlowGraphReference.transformSingle(transformer, data) return this @@ -136,7 +142,6 @@ internal class FirPropertyImpl( override fun transformOtherChildren(transformer: FirTransformer, data: D): FirPropertyImpl { transformAnnotations(transformer, data) - typeParameters.transformInplace(transformer, data) return this } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirRegularClassImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirRegularClassImpl.kt index c93631b89aa..36d2e627482 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirRegularClassImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirRegularClassImpl.kt @@ -64,7 +64,7 @@ internal class FirRegularClassImpl( override fun transformChildren(transformer: FirTransformer, data: D): FirRegularClassImpl { transformAnnotations(transformer, data) - typeParameters.transformInplace(transformer, data) + transformTypeParameters(transformer, data) transformStatus(transformer, data) transformControlFlowGraphReference(transformer, data) transformDeclarations(transformer, data) @@ -78,6 +78,11 @@ internal class FirRegularClassImpl( return this } + override fun transformTypeParameters(transformer: FirTransformer, data: D): FirRegularClassImpl { + typeParameters.transformInplace(transformer, data) + return this + } + override fun transformStatus(transformer: FirTransformer, data: D): FirRegularClassImpl { status = status.transformSingle(transformer, data) return this diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirSimpleFunctionImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirSimpleFunctionImpl.kt index b06b2e4f42d..6b22c1d4210 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirSimpleFunctionImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirSimpleFunctionImpl.kt @@ -76,7 +76,7 @@ open class FirSimpleFunctionImpl @FirImplementationDetail constructor( transformStatus(transformer, data) transformContractDescription(transformer, data) transformAnnotations(transformer, data) - typeParameters.transformInplace(transformer, data) + transformTypeParameters(transformer, data) return this } @@ -120,6 +120,11 @@ open class FirSimpleFunctionImpl @FirImplementationDetail constructor( return this } + override fun transformTypeParameters(transformer: FirTransformer, data: D): FirSimpleFunctionImpl { + typeParameters.transformInplace(transformer, data) + return this + } + override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) { resolvePhase = newResolvePhase } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirTypeAliasImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirTypeAliasImpl.kt index 0131accc06a..d3439368c4c 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirTypeAliasImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirTypeAliasImpl.kt @@ -51,7 +51,7 @@ internal class FirTypeAliasImpl( override fun transformChildren(transformer: FirTransformer, data: D): FirTypeAliasImpl { transformStatus(transformer, data) - typeParameters.transformInplace(transformer, data) + transformTypeParameters(transformer, data) expandedTypeRef = expandedTypeRef.transformSingle(transformer, data) transformAnnotations(transformer, data) return this @@ -62,6 +62,11 @@ internal class FirTypeAliasImpl( return this } + override fun transformTypeParameters(transformer: FirTransformer, data: D): FirTypeAliasImpl { + typeParameters.transformInplace(transformer, data) + return this + } + override fun transformAnnotations(transformer: FirTransformer, data: D): FirTypeAliasImpl { annotations.transformInplace(transformer, data) return this diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/synthetic/FirSyntheticProperty.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/synthetic/FirSyntheticProperty.kt index 325a77f7d68..81fa0003aed 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/synthetic/FirSyntheticProperty.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/synthetic/FirSyntheticProperty.kt @@ -127,6 +127,10 @@ class FirSyntheticProperty( throw AssertionError("Transformation of synthetic property isn't supported") } + override fun transformTypeParameters(transformer: FirTransformer, data: D): FirProperty { + throw AssertionError("Transformation of synthetic property isn't supported") + } + override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) { resolvePhase = newResolvePhase } diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/synthetic/FirSyntheticPropertyAccessor.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/synthetic/FirSyntheticPropertyAccessor.kt index 341d845f3e2..efaf65fbcd0 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/synthetic/FirSyntheticPropertyAccessor.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/synthetic/FirSyntheticPropertyAccessor.kt @@ -113,6 +113,10 @@ class FirSyntheticPropertyAccessor( throw AssertionError("Transformation of synthetic property accessor isn't supported") } + override fun transformTypeParameters(transformer: FirTransformer, data: D): FirPropertyAccessor { + throw AssertionError("Transformation of synthetic property accessor isn't supported") + } + override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) { throw AssertionError("Mutation of synthetic property accessor isn't supported") } diff --git a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/FirTreeBuilder.kt b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/FirTreeBuilder.kt index 0a7e15ec530..7a794e44164 100644 --- a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/FirTreeBuilder.kt +++ b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/FirTreeBuilder.kt @@ -36,7 +36,7 @@ object FirTreeBuilder : AbstractFirTreeBuilder() { val typeParameter = element("TypeParameter", Declaration, typeParameterRef, annotatedDeclaration, symbolOwner) val typeParameterRefsOwner = element("TypeParameterRefsOwner", Declaration) val typeParametersOwner = element("TypeParametersOwner", Declaration, typeParameterRefsOwner) - val memberDeclaration = element("MemberDeclaration", Declaration, annotatedDeclaration) + val memberDeclaration = element("MemberDeclaration", Declaration, annotatedDeclaration, typeParameterRefsOwner) val callableMemberDeclaration = element("CallableMemberDeclaration", Declaration, callableDeclaration, memberDeclaration) val variable = element("Variable", Declaration, callableDeclaration, annotatedDeclaration, statement) diff --git a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/NodeConfigurator.kt b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/NodeConfigurator.kt index eeb601cf6c4..8719b2c8c84 100644 --- a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/NodeConfigurator.kt +++ b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/NodeConfigurator.kt @@ -55,11 +55,11 @@ object NodeConfigurator : AbstractFieldConfigurator(FirTreeBuild } typeParametersOwner.configure { - +typeParameters + +typeParameters.withTransform() } typeParameterRefsOwner.configure { - +typeParameterRefs + +typeParameterRefs.withTransform() } resolvable.configure { @@ -307,7 +307,6 @@ object NodeConfigurator : AbstractFieldConfigurator(FirTreeBuild +symbol("FirPropertySymbol") +field("backingFieldSymbol", backingFieldSymbolType) +booleanField("isLocal") - +typeParameters +status }