[IR] Resolve fake overrides inside getFunctionDeclaration function
#KT-64807
This commit is contained in:
@@ -41,7 +41,9 @@ import org.jetbrains.kotlin.util.OperatorNameConventions
|
|||||||
abstract class InlineFunctionResolver {
|
abstract class InlineFunctionResolver {
|
||||||
open fun getFunctionDeclaration(symbol: IrFunctionSymbol): IrFunction? {
|
open fun getFunctionDeclaration(symbol: IrFunctionSymbol): IrFunction? {
|
||||||
if (shouldExcludeFunctionFromInlining(symbol)) return null
|
if (shouldExcludeFunctionFromInlining(symbol)) return null
|
||||||
return symbol.owner
|
|
||||||
|
val owner = symbol.owner
|
||||||
|
return (owner as? IrSimpleFunction)?.resolveFakeOverride() ?: owner
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun shouldExcludeFunctionFromInlining(symbol: IrFunctionSymbol): Boolean {
|
protected open fun shouldExcludeFunctionFromInlining(symbol: IrFunctionSymbol): Boolean {
|
||||||
@@ -108,8 +110,7 @@ class FunctionInlining(
|
|||||||
if (!callee.needsInlining)
|
if (!callee.needsInlining)
|
||||||
return expression
|
return expression
|
||||||
|
|
||||||
val target = (callee as? IrSimpleFunction)?.resolveFakeOverride() ?: callee
|
val actualCallee = inlineFunctionResolver.getFunctionDeclaration(callee.symbol)
|
||||||
val actualCallee = inlineFunctionResolver.getFunctionDeclaration(target.symbol)
|
|
||||||
if (actualCallee?.body == null) {
|
if (actualCallee?.body == null) {
|
||||||
return expression
|
return expression
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user