Remove assertion about dispatch receiver in scripts

#KT-42530 fixed
This commit is contained in:
Ilya Chernikov
2020-12-17 19:27:38 +01:00
parent 0671fd9aaa
commit 65cf941b9b
3 changed files with 17 additions and 1 deletions
@@ -328,7 +328,8 @@ public class DescriptorResolver {
}
destructuringVariables = () -> {
assert owner.getDispatchReceiverParameter() == null
ReceiverParameterDescriptor dispatchReceiver = owner.getDispatchReceiverParameter();
assert dispatchReceiver == null || dispatchReceiver.getContainingDeclaration() instanceof ScriptDescriptor
: "Destructuring declarations are only be parsed for lambdas, and they must not have a dispatch receiver";
LexicalScope scopeForDestructuring =
ScopeUtilsKt.createScopeForDestructuring(scope, owner.getExtensionReceiverParameter());