[JVM_IR] Deal with inline-class arguments in large arity lambdas.
FunctionNVarargBridgeLowering checked the name of the method instead of whether the method overrides an invoke method. That doesn't work when the name of the function gets mangled because of inline class arguments. Fixed KT-45084.
This commit is contained in:
committed by
Alexander Udalov
parent
1181854bd6
commit
b6fa28ea81
+5
-2
@@ -91,8 +91,11 @@ private class FunctionNVarargBridgeLowering(val context: JvmBackendContext) :
|
||||
)
|
||||
|
||||
// Add vararg invoke bridge
|
||||
val invokeFunction = declaration.functions.single {
|
||||
it.name.asString() == "invoke" && it.valueParameters.size == superType.arguments.size - if (it.isSuspend) 0 else 1
|
||||
val invokeFunction = declaration.functions.single { function ->
|
||||
val overridesInvoke = function.overriddenSymbols.any { symbol ->
|
||||
symbol.owner.name.asString() == "invoke"
|
||||
}
|
||||
overridesInvoke && function.valueParameters.size == superType.arguments.size - if (function.isSuspend) 0 else 1
|
||||
}
|
||||
invokeFunction.overriddenSymbols = emptyList()
|
||||
declaration.addBridge(invokeFunction, functionNInvokeFun.owner)
|
||||
|
||||
Reference in New Issue
Block a user