Fix transforming of coroutine's create when it is suspend lambda with receiver
Unlike ordinary lambdas suspend lambdas has create method which invokes the constructor of the lambda object (continuation). The inliner could not cope with this. The previous change fixed the case of suspend lambda without receiver. This change adds support of suspend lambdas with receiver. #KT-21605: Fixed
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@@ -291,7 +291,7 @@ class MethodInliner(
|
||||
}
|
||||
|
||||
val isContinuationCreate = isContinuation && oldInfo != null && resultNode.name == "create" &&
|
||||
resultNode.desc.startsWith("(" + CONTINUATION_ASM_TYPE.descriptor)
|
||||
resultNode.desc.endsWith(")" + CONTINUATION_ASM_TYPE.descriptor)
|
||||
|
||||
for (capturedParamDesc in info.allRecapturedParameters) {
|
||||
if (capturedParamDesc.fieldName == THIS && isContinuationCreate) {
|
||||
|
||||
Reference in New Issue
Block a user