[IR] Don't pass originalCallee to the inliner

`originalCallee` is supposed to be the owner of the original call.
It can be a fake override, and in the inliner we are using actual
function with body. Apparently we can just stick with the resolved
function.

#KT-64807
This commit is contained in:
Ivan Kylchik
2024-02-19 19:05:15 +01:00
committed by Space Team
parent 0258927d33
commit 2bfd1c8f23
2 changed files with 6 additions and 4 deletions
@@ -57,7 +57,10 @@ abstract class UsefulDeclarationProcessor(
super.visitBlock(expression, data)
if (expression is IrReturnableBlock) {
expression.inlineFunction?.addToUsefulPolyfilledDeclarations()
// We need to extract `originalFunction` here because saved `inlineFunction`
// is actually a copy made in `SaveInlineFunctionsBeforeInlining`.
// Without this, we are not going to find proper intersection in the `saveOnlyIntersectionOfNextDeclarationsFor` method.
expression.inlineFunction?.originalFunction?.addToUsefulPolyfilledDeclarations()
}
}