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:
+3
-2
@@ -519,9 +519,10 @@ class FunctionInlining(
|
|||||||
private fun isLambdaCall(irCall: IrCall): Boolean {
|
private fun isLambdaCall(irCall: IrCall): Boolean {
|
||||||
val callee = irCall.symbol.owner
|
val callee = irCall.symbol.owner
|
||||||
val dispatchReceiver = callee.dispatchReceiverParameter ?: return false
|
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
|
&& callee.name == OperatorNameConventions.INVOKE
|
||||||
&& irCall.dispatchReceiver?.unwrapAdditionalImplicitCastsIfNeeded() is IrGetValue
|
&& irCall.dispatchReceiver?.unwrapAdditionalImplicitCastsIfNeeded() is IrGetValue
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user