Allow destructuring in suspend lambda with suspend componentX
#KT-16113 Fixed
This commit is contained in:
@@ -80,6 +80,7 @@ enum class LexicalScopeKind(val withLocalDescriptors: Boolean) {
|
||||
PROPERTY_DELEGATE_METHOD(false),
|
||||
|
||||
FUNCTION_HEADER(false),
|
||||
FUNCTION_HEADER_FOR_DESTRUCTURING(false),
|
||||
FUNCTION_INNER_SCOPE(true),
|
||||
|
||||
TYPE_ALIAS_HEADER(false),
|
||||
|
||||
@@ -201,9 +201,12 @@ fun LexicalScope.replaceImportingScopes(importingScopeChain: ImportingScope?): L
|
||||
return LexicalScopeWrapper(this, newImportingScopeChain)
|
||||
}
|
||||
|
||||
fun LexicalScope.addImplicitReceiver(newReceiver: ReceiverParameterDescriptor?): LexicalScope {
|
||||
if (newReceiver == null) return this
|
||||
return LexicalScopeImpl(parent, ownerDescriptor, isOwnerDescriptorAccessibleByLabel, newReceiver, kind)
|
||||
fun LexicalScope.createScopeForDestructuring(newReceiver: ReceiverParameterDescriptor?): LexicalScope {
|
||||
return LexicalScopeImpl(
|
||||
parent, ownerDescriptor, isOwnerDescriptorAccessibleByLabel,
|
||||
newReceiver ?: implicitReceiver,
|
||||
LexicalScopeKind.FUNCTION_HEADER_FOR_DESTRUCTURING
|
||||
)
|
||||
}
|
||||
|
||||
private class LexicalScopeWrapper(val delegate: LexicalScope, val newImportingScopeChain: ImportingScope): LexicalScope by delegate {
|
||||
|
||||
Reference in New Issue
Block a user