[FIR] drop redundant replace from wrapped expression

They were introduced for lazy

^KT-59687
This commit is contained in:
Dmitrii Gridin
2023-07-01 23:08:13 +02:00
committed by Space Team
parent a81523fa74
commit 43705d9a75
11 changed files with 2 additions and 36 deletions
@@ -32,7 +32,5 @@ abstract class FirLambdaArgumentExpression : FirWrappedArgumentExpression() {
abstract override fun replaceAnnotations(newAnnotations: List<FirAnnotation>) abstract override fun replaceAnnotations(newAnnotations: List<FirAnnotation>)
abstract override fun replaceExpression(newExpression: FirExpression)
abstract override fun <D> transformAnnotations(transformer: FirTransformer<D>, data: D): FirLambdaArgumentExpression abstract override fun <D> transformAnnotations(transformer: FirTransformer<D>, data: D): FirLambdaArgumentExpression
} }
@@ -34,7 +34,5 @@ abstract class FirNamedArgumentExpression : FirWrappedArgumentExpression() {
abstract override fun replaceAnnotations(newAnnotations: List<FirAnnotation>) abstract override fun replaceAnnotations(newAnnotations: List<FirAnnotation>)
abstract override fun replaceExpression(newExpression: FirExpression)
abstract override fun <D> transformAnnotations(transformer: FirTransformer<D>, data: D): FirNamedArgumentExpression abstract override fun <D> transformAnnotations(transformer: FirTransformer<D>, data: D): FirNamedArgumentExpression
} }
@@ -32,7 +32,5 @@ abstract class FirSpreadArgumentExpression : FirWrappedArgumentExpression() {
abstract override fun replaceAnnotations(newAnnotations: List<FirAnnotation>) abstract override fun replaceAnnotations(newAnnotations: List<FirAnnotation>)
abstract override fun replaceExpression(newExpression: FirExpression)
abstract override fun <D> transformAnnotations(transformer: FirTransformer<D>, data: D): FirSpreadArgumentExpression abstract override fun <D> transformAnnotations(transformer: FirTransformer<D>, data: D): FirSpreadArgumentExpression
} }
@@ -32,7 +32,5 @@ abstract class FirWrappedArgumentExpression : FirWrappedExpression() {
abstract override fun replaceAnnotations(newAnnotations: List<FirAnnotation>) abstract override fun replaceAnnotations(newAnnotations: List<FirAnnotation>)
abstract override fun replaceExpression(newExpression: FirExpression)
abstract override fun <D> transformAnnotations(transformer: FirTransformer<D>, data: D): FirWrappedArgumentExpression abstract override fun <D> transformAnnotations(transformer: FirTransformer<D>, data: D): FirWrappedArgumentExpression
} }
@@ -32,9 +32,5 @@ abstract class FirWrappedDelegateExpression : FirWrappedExpression() {
abstract override fun replaceAnnotations(newAnnotations: List<FirAnnotation>) abstract override fun replaceAnnotations(newAnnotations: List<FirAnnotation>)
abstract override fun replaceExpression(newExpression: FirExpression)
abstract fun replaceDelegateProvider(newDelegateProvider: FirExpression)
abstract override fun <D> transformAnnotations(transformer: FirTransformer<D>, data: D): FirWrappedDelegateExpression abstract override fun <D> transformAnnotations(transformer: FirTransformer<D>, data: D): FirWrappedDelegateExpression
} }
@@ -31,7 +31,5 @@ abstract class FirWrappedExpression : FirExpression() {
abstract override fun replaceAnnotations(newAnnotations: List<FirAnnotation>) abstract override fun replaceAnnotations(newAnnotations: List<FirAnnotation>)
abstract fun replaceExpression(newExpression: FirExpression)
abstract override fun <D> transformAnnotations(transformer: FirTransformer<D>, data: D): FirWrappedExpression abstract override fun <D> transformAnnotations(transformer: FirTransformer<D>, data: D): FirWrappedExpression
} }
@@ -50,8 +50,4 @@ internal class FirLambdaArgumentExpressionImpl(
override fun replaceAnnotations(newAnnotations: List<FirAnnotation>) { override fun replaceAnnotations(newAnnotations: List<FirAnnotation>) {
annotations = newAnnotations.toMutableOrEmpty() annotations = newAnnotations.toMutableOrEmpty()
} }
override fun replaceExpression(newExpression: FirExpression) {
expression = newExpression
}
} }
@@ -52,8 +52,4 @@ internal class FirNamedArgumentExpressionImpl(
override fun replaceAnnotations(newAnnotations: List<FirAnnotation>) { override fun replaceAnnotations(newAnnotations: List<FirAnnotation>) {
annotations = newAnnotations.toMutableOrEmpty() annotations = newAnnotations.toMutableOrEmpty()
} }
override fun replaceExpression(newExpression: FirExpression) {
expression = newExpression
}
} }
@@ -50,8 +50,4 @@ internal class FirSpreadArgumentExpressionImpl(
override fun replaceAnnotations(newAnnotations: List<FirAnnotation>) { override fun replaceAnnotations(newAnnotations: List<FirAnnotation>) {
annotations = newAnnotations.toMutableOrEmpty() annotations = newAnnotations.toMutableOrEmpty()
} }
override fun replaceExpression(newExpression: FirExpression) {
expression = newExpression
}
} }
@@ -52,12 +52,4 @@ internal class FirWrappedDelegateExpressionImpl(
override fun replaceAnnotations(newAnnotations: List<FirAnnotation>) { override fun replaceAnnotations(newAnnotations: List<FirAnnotation>) {
annotations = newAnnotations.toMutableOrEmpty() annotations = newAnnotations.toMutableOrEmpty()
} }
override fun replaceExpression(newExpression: FirExpression) {
expression = newExpression
}
override fun replaceDelegateProvider(newDelegateProvider: FirExpression) {
delegateProvider = newDelegateProvider
}
} }
@@ -641,11 +641,11 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
} }
wrappedExpression.configure { wrappedExpression.configure {
+field(expression).withReplace() +field(expression)
} }
wrappedDelegateExpression.configure { wrappedDelegateExpression.configure {
+field("delegateProvider", expression).withReplace() +field("delegateProvider", expression)
} }
enumEntryDeserializedAccessExpression.configure { enumEntryDeserializedAccessExpression.configure {