Use doResume name for suspend lambdas context (KT-16481)
#KT-16481 Fixed
This commit is contained in:
committed by
Nikolay Krasko
parent
dffbe0f707
commit
f0be88fc07
@@ -328,6 +328,11 @@ class CoroutineCodegen private constructor(
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun shouldCreateByLambda(
|
||||
originalSuspendLambdaDescriptor: CallableDescriptor,
|
||||
declaration: KtElement): Boolean {
|
||||
return (declaration is KtFunctionLiteral && originalSuspendLambdaDescriptor.isSuspendLambda)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun createByLambda(
|
||||
@@ -336,8 +341,7 @@ class CoroutineCodegen private constructor(
|
||||
declaration: KtElement,
|
||||
classBuilder: ClassBuilder
|
||||
): ClosureCodegen? {
|
||||
if (declaration !is KtFunctionLiteral) return null
|
||||
if (!originalSuspendLambdaDescriptor.isSuspendLambda) return null
|
||||
if (!shouldCreateByLambda(originalSuspendLambdaDescriptor, declaration)) return null
|
||||
|
||||
return CoroutineCodegen(
|
||||
expressionCodegen,
|
||||
|
||||
Reference in New Issue
Block a user