diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/scopes/utils/ScopeUtils.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/scopes/utils/ScopeUtils.kt index 51209f389d4..03027108ef4 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/scopes/utils/ScopeUtils.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/scopes/utils/ScopeUtils.kt @@ -180,7 +180,7 @@ fun LexicalScope.addImportingScopes(importScopes: List): Lexical val lastLexicalScope = parentsWithSelf.last { it is LexicalScope } val firstImporting = lastLexicalScope.parent as ImportingScope val newFirstImporting = chainImportingScopes(importScopes, firstImporting) - return LexicalScopeWrapper(this, newFirstImporting!!) + return replaceImportingScopes(newFirstImporting) } fun LexicalScope.addImportingScope(importScope: ImportingScope): LexicalScope