diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt index e54ef1143e0..63db8eac192 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt @@ -18,7 +18,6 @@ import org.jetbrains.kotlin.fir.expressions.impl.FirUnitExpression import org.jetbrains.kotlin.fir.references.FirReference import org.jetbrains.kotlin.fir.references.FirResolvedNamedReference import org.jetbrains.kotlin.fir.references.FirSuperReference -import org.jetbrains.kotlin.fir.references.builder.buildResolvedNamedReference import org.jetbrains.kotlin.fir.references.impl.FirPropertyFromParameterResolvedNamedReference import org.jetbrains.kotlin.fir.resolve.* import org.jetbrains.kotlin.fir.resolve.calls.SyntheticPropertySymbol @@ -687,12 +686,7 @@ class Fir2IrVisitor( val convertibleCall = if (functionCall.toResolvedCallableSymbol()?.fir is FirIntegerOperator) { functionCall.copy().transformSingle(integerApproximator, null) } else { - val resolvedSymbol = functionCall.resolvedNamedFunctionSymbol() - if (resolvedSymbol != null) { - functionCall.replaceCalleeReferenceWithOverridden(resolvedSymbol) - } else { - functionCall - } + functionCall } return convertibleCall.toIrExpression(convertibleCall.typeRef) .applyCallArguments(convertibleCall).applyTypeArguments(convertibleCall).applyReceivers(convertibleCall) @@ -703,21 +697,6 @@ class Fir2IrVisitor( return calleeReference.resolvedSymbol as? FirNamedFunctionSymbol } - // Use the generic invoke & next methods to match bridges generated by the backend. - private fun FirFunctionCall.replaceCalleeReferenceWithOverridden(resolvedSymbol: FirNamedFunctionSymbol): FirFunctionCall { - val overriddenSymbol = resolvedSymbol.overriddenSymbol ?: return this - if (resolvedSymbol.callableId.isInvoke() || resolvedSymbol.callableId.isIteratorNext()) { - return copy( - calleeReference = buildResolvedNamedReference { - source = calleeReference.source - name = calleeReference.name - this.resolvedSymbol = overriddenSymbol - } - ) - } - return this - } - override fun visitAnnotationCall(annotationCall: FirAnnotationCall, data: Any?): IrElement { return annotationCall.toIrExpression().applyCallArguments(annotationCall) }