Change isLambdaCall logic in FunctionInlining

We are allowing to inline `KFunction` invoke call. This is needed for
JVM paired with K2 compiler. Probably this can be reverted after
#KT-57249 fix.
This commit is contained in:
Ivan Kylchik
2023-03-10 12:09:58 +01:00
committed by Space Team
parent d2e92fd70d
commit 5b3d6583af
@@ -519,9 +519,10 @@ class FunctionInlining(
private fun isLambdaCall(irCall: IrCall): Boolean {
val callee = irCall.symbol.owner
val dispatchReceiver = callee.dispatchReceiverParameter ?: return false
assert(!dispatchReceiver.type.isKFunction())
// Uncomment or delete depending on KT-57249 status
// assert(!dispatchReceiver.type.isKFunction())
return (dispatchReceiver.type.isFunction() || dispatchReceiver.type.isSuspendFunction())
return (dispatchReceiver.type.isFunctionOrKFunction() || dispatchReceiver.type.isSuspendFunctionOrKFunction())
&& callee.name == OperatorNameConventions.INVOKE
&& irCall.dispatchReceiver?.unwrapAdditionalImplicitCastsIfNeeded() is IrGetValue
}