1442dd6c2b
There was an exponential complexity in case we have a chain of nested LexicalScopeWrapper instances: we were walking through the chain and on each step running the algorithm recursively. Such a case is possible in scripts where each line contains LexicalScopeWrapper The fix looks safe to me because delegate was used there for checking !is ImportingScope && !is LexicalChainedScope In all other means, being recursively run the algorithm does the same job. #KT-22740 Fixed