From 5577f0f8cb0ab4fec24ffcd2b4a46c30aeb6f07b Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Mon, 9 Dec 2019 15:14:45 +0300 Subject: [PATCH] [TMP] Make context in inference components universal --- .../kotlin/fir/java/declarations/FirJavaConstructor.kt | 4 ++++ .../kotlin/fir/java/declarations/FirJavaField.kt | 4 ++++ .../kotlin/fir/resolve/calls/InferenceUtil.kt | 4 ++-- .../transformers/body/resolve/BodyResolveUtils.kt | 7 +------ .../body/resolve/FirDeclarationsResolveTransformer.kt | 10 ++++++---- compiler/fir/resolve/testData/resolve/cfg/complex.txt | 2 +- .../problems/samConversionInConstructorCall.txt | 2 +- .../kotlin/fir/declarations/FirTypedDeclaration.kt | 2 ++ .../fir/declarations/impl/FirAnonymousFunctionImpl.kt | 4 ++++ .../kotlin/fir/declarations/impl/FirConstructorImpl.kt | 4 ++++ .../impl/FirDefaultSetterValueParameter.kt | 4 ++++ .../fir/declarations/impl/FirErrorFunctionImpl.kt | 4 ++++ .../kotlin/fir/declarations/impl/FirFieldImpl.kt | 4 ++++ .../fir/declarations/impl/FirModifiableConstructor.kt | 2 ++ .../fir/declarations/impl/FirModifiableFunction.kt | 2 ++ .../fir/declarations/impl/FirModifiableVariable.kt | 2 ++ .../fir/declarations/impl/FirPropertyAccessorImpl.kt | 4 ++++ .../kotlin/fir/declarations/impl/FirPropertyImpl.kt | 4 ++++ .../fir/declarations/impl/FirSimpleFunctionImpl.kt | 4 ++++ .../fir/declarations/impl/FirValueParameterImpl.kt | 4 ++++ .../kotlin/fir/tree/generator/NodeConfigurator.kt | 3 +-- 21 files changed, 64 insertions(+), 16 deletions(-) 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 9b7637959bd..376941aec57 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 @@ -112,4 +112,8 @@ class FirJavaConstructor( } override var containerSource: DeserializedContainerSource? = null + + override fun replaceReturnTypeRef(newReturnTypeRef: FirTypeRef) { + returnTypeRef = newReturnTypeRef + } } \ No newline at end of file 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 ad2f53ce46b..0af2eead9eb 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 @@ -97,6 +97,10 @@ class FirJavaField( return this } + override fun replaceReturnTypeRef(newReturnTypeRef: FirTypeRef) { + returnTypeRef = newReturnTypeRef + } + override val delegate: FirExpression? get() = null diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/InferenceUtil.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/InferenceUtil.kt index 86a8287cf89..27c13fb8f26 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/InferenceUtil.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/InferenceUtil.kt @@ -9,6 +9,7 @@ import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.resolve.ScopeSession import org.jetbrains.kotlin.fir.resolve.toSymbol import org.jetbrains.kotlin.fir.resolve.transformers.ReturnTypeCalculator +import org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.UniversalConeInferenceContext import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol import org.jetbrains.kotlin.fir.types.* import org.jetbrains.kotlin.resolve.calls.inference.components.ConstraintIncorporator @@ -19,7 +20,6 @@ import org.jetbrains.kotlin.resolve.calls.inference.model.NewConstraintSystemImp import org.jetbrains.kotlin.types.AbstractTypeApproximator import org.jetbrains.kotlin.types.checker.KotlinTypeRefiner import org.jetbrains.kotlin.types.model.SimpleTypeMarker -import org.jetbrains.kotlin.types.model.TypeSystemInferenceExtensionContextDelegate fun ConeTypeContext.hasNullableSuperType(type: ConeKotlinType): Boolean { if (type is ConeClassLikeType) return false @@ -41,7 +41,7 @@ class TypeParameterBasedTypeVariable(val typeParameterSymbol: FirTypeParameterSy ConeTypeVariable(typeParameterSymbol.name.identifier) class InferenceComponents( - val ctx: TypeSystemInferenceExtensionContextDelegate, + val ctx: UniversalConeInferenceContext, val session: FirSession, val returnTypeCalculator: ReturnTypeCalculator, val scopeSession: ScopeSession diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/BodyResolveUtils.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/BodyResolveUtils.kt index 72ec095995b..987cca611bd 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/BodyResolveUtils.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/BodyResolveUtils.kt @@ -15,12 +15,7 @@ import org.jetbrains.kotlin.fir.resolve.calls.InferenceComponents import org.jetbrains.kotlin.fir.resolve.dfa.DataFlowInferenceContext import org.jetbrains.kotlin.fir.resolve.transformers.ReturnTypeCalculator import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol -import org.jetbrains.kotlin.fir.types.ConeClassErrorType -import org.jetbrains.kotlin.fir.types.ErrorTypeConstructor import org.jetbrains.kotlin.fir.types.FirTypeRef -import org.jetbrains.kotlin.types.model.KotlinTypeMarker -import org.jetbrains.kotlin.types.model.SimpleTypeMarker -import org.jetbrains.kotlin.types.model.TypeConstructorMarker import org.jetbrains.kotlin.types.model.TypeSystemInferenceExtensionContextDelegate inline fun FirBasedSymbol<*>.firUnsafe(): T { @@ -37,7 +32,7 @@ internal inline var FirExpression.resultType: FirTypeRef replaceTypeRef(type) } -internal interface UniversalConeInferenceContext : +interface UniversalConeInferenceContext : ConeInferenceContext, TypeSystemInferenceExtensionContextDelegate, DataFlowInferenceContext internal fun FirSession.inferenceContext(): UniversalConeInferenceContext { 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 f6993937158..04b4d4f033e 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 @@ -12,12 +12,15 @@ import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertyAccessor import org.jetbrains.kotlin.fir.declarations.impl.FirValueParameterImpl import org.jetbrains.kotlin.fir.diagnostics.DiagnosticKind import org.jetbrains.kotlin.fir.diagnostics.FirSimpleDiagnostic +import org.jetbrains.kotlin.fir.expressions.FirExpression import org.jetbrains.kotlin.fir.expressions.FirStatement import org.jetbrains.kotlin.fir.resolve.* import org.jetbrains.kotlin.fir.resolve.calls.ImplicitDispatchReceiverValue import org.jetbrains.kotlin.fir.resolve.calls.ImplicitExtensionReceiverValue import org.jetbrains.kotlin.fir.resolve.calls.extractLambdaInfoFromFunctionalType +import org.jetbrains.kotlin.fir.resolve.substitution.ConeSubstitutor import org.jetbrains.kotlin.fir.resolve.transformers.ControlFlowGraphReferenceTransformer +import org.jetbrains.kotlin.fir.resolve.transformers.FirCallCompletionResultsWriterTransformer import org.jetbrains.kotlin.fir.resolve.transformers.FirStatusResolveTransformer.Companion.resolveStatus import org.jetbrains.kotlin.fir.resolve.transformers.StoreType import org.jetbrains.kotlin.fir.resolve.transformers.transformVarargTypeToArrayType @@ -32,6 +35,7 @@ import org.jetbrains.kotlin.fir.types.impl.FirResolvedTypeRefImpl import org.jetbrains.kotlin.fir.visitors.CompositeTransformResult import org.jetbrains.kotlin.fir.visitors.FirTransformer import org.jetbrains.kotlin.fir.visitors.compose +import org.jetbrains.kotlin.fir.visitors.transformSingle import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.utils.addIfNotNull @@ -460,11 +464,9 @@ class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransformer) session, ConeSubstitutor.Empty, returnTypeCalculator, - inferenceComponents.approximator, - integerOperatorsTypeUpdater, - integerLiteralTypeApproximator + inferenceComponents.approximator ) - af.transformSingle(writer, data.expectedTypeRef.coneTypeSafe()?.toExpectedType()) + af.transformSingle(writer, null) val returnTypes = dataFlowAnalyzer.returnExpressionsOfAnonymousFunction(af).mapNotNull { (it as? FirExpression)?.resultType?.coneTypeUnsafe() } af.replaceReturnTypeRef(af.returnTypeRef.resolvedTypeFromPrototype(inferenceComponents.ctx.commonSuperTypeOrNull(returnTypes) ?: session.builtinTypes.unitType.coneTypeUnsafe())) af.replaceTypeRef(af.constructFunctionalTypeRef(session)) diff --git a/compiler/fir/resolve/testData/resolve/cfg/complex.txt b/compiler/fir/resolve/testData/resolve/cfg/complex.txt index f64d4c4366f..bee72386717 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/complex.txt +++ b/compiler/fir/resolve/testData/resolve/cfg/complex.txt @@ -2,7 +2,7 @@ FILE: complex.kt @R|kotlin/jvm/Throws|((#), (#)) public final fun fetchPluginReleaseDate(pluginId: R|class error: Symbol not found, for `PluginId`|, version: R|kotlin/String|, channel: R|kotlin/String?|): R|class error: Symbol not found, for `LocalDate?`| { lval url: R|kotlin/String| = (String(https://plugins.jetbrains.com/api/plugins/), R|/pluginId|.#.R|kotlin/toString|(), String(/updates?version=), R|/version|.R|kotlin/Any.toString|()) lval pluginDTOs: R|kotlin/Array| = try { - #.#(R|/url|).#( = connect@fun (): { + #.#(R|/url|).#( = connect@fun (): R|class error: Unresolved name: fromJson| { #().#().#(#.#.#(), (Q|kotlin/Array|).R|kotlin/jvm/java|) } ) diff --git a/compiler/fir/resolve/testData/resolve/problems/samConversionInConstructorCall.txt b/compiler/fir/resolve/testData/resolve/problems/samConversionInConstructorCall.txt index f6022e0acd6..26c8a1e18ad 100644 --- a/compiler/fir/resolve/testData/resolve/problems/samConversionInConstructorCall.txt +++ b/compiler/fir/resolve/testData/resolve/problems/samConversionInConstructorCall.txt @@ -1,6 +1,6 @@ FILE: main.kt public final fun test(): R|kotlin/Unit| { - #( = Foo@fun (): { + #( = Foo@fun (): R|class error: Unresolved name: it| { # } ) diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypedDeclaration.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypedDeclaration.kt index a730e81c9a8..3d98fb73eb9 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypedDeclaration.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/FirTypedDeclaration.kt @@ -26,5 +26,7 @@ interface FirTypedDeclaration : FirDeclaration, FirAnnotationContainer { override fun accept(visitor: FirVisitor, data: D): R = visitor.visitTypedDeclaration(this, data) + fun replaceReturnTypeRef(newReturnTypeRef: FirTypeRef) + fun transformReturnTypeRef(transformer: FirTransformer, data: D): FirTypedDeclaration } 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 205626a7666..2bc911eaa7a 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 @@ -99,6 +99,10 @@ class FirAnonymousFunctionImpl( resolvePhase = newResolvePhase } + override fun replaceReturnTypeRef(newReturnTypeRef: FirTypeRef) { + returnTypeRef = newReturnTypeRef + } + override fun replaceTypeRef(newTypeRef: FirTypeRef) { typeRef = newTypeRef } 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 4e28adc7867..eb46f3a7172 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 @@ -103,4 +103,8 @@ open class FirConstructorImpl( override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) { resolvePhase = newResolvePhase } + + override fun replaceReturnTypeRef(newReturnTypeRef: FirTypeRef) { + returnTypeRef = newReturnTypeRef + } } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirDefaultSetterValueParameter.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirDefaultSetterValueParameter.kt index 329c2f53ee6..4c2faa73028 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirDefaultSetterValueParameter.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirDefaultSetterValueParameter.kt @@ -102,4 +102,8 @@ class FirDefaultSetterValueParameter( override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) { resolvePhase = newResolvePhase } + + override fun replaceReturnTypeRef(newReturnTypeRef: FirTypeRef) { + returnTypeRef = newReturnTypeRef + } } 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 669de07abc3..132889144d8 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 @@ -85,4 +85,8 @@ class FirErrorFunctionImpl( override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) { resolvePhase = newResolvePhase } + + override fun replaceReturnTypeRef(newReturnTypeRef: FirTypeRef) { + returnTypeRef = newReturnTypeRef + } } 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 68e54effe65..7b2a4f04708 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 @@ -98,4 +98,8 @@ class FirFieldImpl( override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) { resolvePhase = newResolvePhase } + + override fun replaceReturnTypeRef(newReturnTypeRef: FirTypeRef) { + returnTypeRef = newReturnTypeRef + } } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirModifiableConstructor.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirModifiableConstructor.kt index da652fe1c31..3353273453b 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirModifiableConstructor.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirModifiableConstructor.kt @@ -60,4 +60,6 @@ abstract class FirModifiableConstructor : FirPureAbstractElement(), FirConstruct abstract override fun transformStatus(transformer: FirTransformer, data: D): FirModifiableConstructor abstract override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) + + abstract override fun replaceReturnTypeRef(newReturnTypeRef: FirTypeRef) } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirModifiableFunction.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirModifiableFunction.kt index 425a3092f54..b4d66379b40 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirModifiableFunction.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirModifiableFunction.kt @@ -48,4 +48,6 @@ interface FirModifiableFunction> : FirFunction, FirAbstra override fun transformValueParameters(transformer: FirTransformer, data: D): FirModifiableFunction override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) + + override fun replaceReturnTypeRef(newReturnTypeRef: FirTypeRef) } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirModifiableVariable.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirModifiableVariable.kt index d1e6c3f0d8c..3afd8637a19 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirModifiableVariable.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirModifiableVariable.kt @@ -53,4 +53,6 @@ interface FirModifiableVariable> : FirVariable, FirAbstra override fun transformOtherChildren(transformer: FirTransformer, data: D): FirModifiableVariable override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) + + override fun replaceReturnTypeRef(newReturnTypeRef: FirTypeRef) } 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 8bd0b8de308..2ab2f844828 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 @@ -109,4 +109,8 @@ open class FirPropertyAccessorImpl( override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) { resolvePhase = newResolvePhase } + + override fun replaceReturnTypeRef(newReturnTypeRef: FirTypeRef) { + returnTypeRef = newReturnTypeRef + } } 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 b231b98821d..ce6d13654a7 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 @@ -125,4 +125,8 @@ class FirPropertyImpl( override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) { resolvePhase = newResolvePhase } + + override fun replaceReturnTypeRef(newReturnTypeRef: FirTypeRef) { + returnTypeRef = newReturnTypeRef + } } 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 2c25c5cf920..7a503aca65e 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 @@ -110,4 +110,8 @@ open class FirSimpleFunctionImpl( override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) { resolvePhase = newResolvePhase } + + override fun replaceReturnTypeRef(newReturnTypeRef: FirTypeRef) { + returnTypeRef = newReturnTypeRef + } } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirValueParameterImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirValueParameterImpl.kt index e5ee22cb5b2..577ca394c9c 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirValueParameterImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirValueParameterImpl.kt @@ -102,4 +102,8 @@ open class FirValueParameterImpl( override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) { resolvePhase = newResolvePhase } + + override fun replaceReturnTypeRef(newReturnTypeRef: FirTypeRef) { + returnTypeRef = newReturnTypeRef + } } 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 7465795ce47..4a02df5c254 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 @@ -8,7 +8,6 @@ package org.jetbrains.kotlin.fir.tree.generator import org.jetbrains.kotlin.fir.tree.generator.FieldSets.annotations import org.jetbrains.kotlin.fir.tree.generator.FieldSets.arguments import org.jetbrains.kotlin.fir.tree.generator.FieldSets.body -import org.jetbrains.kotlin.fir.tree.generator.FieldSets.calleeReference import org.jetbrains.kotlin.fir.tree.generator.FieldSets.classKind import org.jetbrains.kotlin.fir.tree.generator.FieldSets.controlFlowGraphReferenceField import org.jetbrains.kotlin.fir.tree.generator.FieldSets.declarations @@ -69,7 +68,7 @@ object NodeConfigurator : AbstractFieldConfigurator() { } typedDeclaration.configure { - +field("returnTypeRef", typeRef).withTransform() + +field("returnTypeRef", typeRef, withReplace = true).withTransform() } callableDeclaration.configure {