JVM IR: fix handling of suspend extension lambdas with captured receiver
The problem in the added test was that a suspend lambda was represented by a function reference with a bound argument for the ObjectRef value, and the corresponding parameter was not the first parameter of the referenced local function. This happens because LocalDeclarationsLowering lifts the local function up and adds a new parameter for the captured ObjectRef (which is bound at the call site), but the original receiver parameter remains the first unbound parameter. So, it's no longer correct to rely on the fact that all bound parameters of a function reference are located in the beginning of the parameter list, which was kind of assumed in the `withIndex` call in `AddContinuationLowering.addCreate`.
This commit is contained in:
+5
@@ -7150,6 +7150,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/inlineSuspendFinally.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("interfaceMethodWithBody.kt")
|
||||
public void testInterfaceMethodWithBody() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/featureIntersection/interfaceMethodWithBody.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("safeCallOnTwoReceiversLong.kt")
|
||||
public void testSafeCallOnTwoReceiversLong_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceiversLong.kt", "kotlin.coroutines.experimental");
|
||||
|
||||
Reference in New Issue
Block a user