Rename
This commit is contained in:
@@ -287,7 +287,7 @@ inline fun <T: Any> LexicalScope.findFirstFromImportingScopes(fetch: (ImportingS
|
||||
return findFirstFromMeAndParent { if (it is ImportingScope) fetch(it) else null }
|
||||
}
|
||||
|
||||
fun LexicalScope.addImportScopes(importScopes: List<ImportingScope>): LexicalScope {
|
||||
fun LexicalScope.addImportingScopes(importScopes: List<ImportingScope>): LexicalScope {
|
||||
if (this is ImportingScope) {
|
||||
return chainImportingScopes(importScopes, this)!!
|
||||
}
|
||||
@@ -299,8 +299,8 @@ fun LexicalScope.addImportScopes(importScopes: List<ImportingScope>): LexicalSco
|
||||
}
|
||||
}
|
||||
|
||||
fun LexicalScope.addImportScope(importScope: ImportingScope): LexicalScope
|
||||
= addImportScopes(listOf(importScope))
|
||||
fun LexicalScope.addImportingScope(importScope: ImportingScope): LexicalScope
|
||||
= addImportingScopes(listOf(importScope))
|
||||
|
||||
fun ImportingScope.withParent(newParent: ImportingScope?): ImportingScope {
|
||||
// TODO: it's a hack for Repl
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.jetbrains.kotlin.resolve.calls.context.ContextDependency
|
||||
import org.jetbrains.kotlin.resolve.scopes.ExplicitImportsScope
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ExpressionReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue
|
||||
import org.jetbrains.kotlin.resolve.scopes.utils.addImportScope
|
||||
import org.jetbrains.kotlin.resolve.scopes.utils.addImportingScope
|
||||
import org.jetbrains.kotlin.types.TypeUtils
|
||||
import org.jetbrains.kotlin.util.descriptorsEqualWithSubstitution
|
||||
import java.util.*
|
||||
@@ -192,7 +192,7 @@ public class ShadowedDeclarationsFilter private constructor(
|
||||
var scope = context.getResolutionScope(bindingContext, resolutionFacade)
|
||||
|
||||
if (descriptorsToImport.isNotEmpty()) {
|
||||
scope = scope.addImportScope(ExplicitImportsScope(descriptorsToImport))
|
||||
scope = scope.addImportingScope(ExplicitImportsScope(descriptorsToImport))
|
||||
}
|
||||
|
||||
val dataFlowInfo = bindingContext.getDataFlowInfo(context)
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@ import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfo
|
||||
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
|
||||
import org.jetbrains.kotlin.resolve.lazy.ResolveSession
|
||||
import org.jetbrains.kotlin.resolve.scopes.LexicalScope
|
||||
import org.jetbrains.kotlin.resolve.scopes.utils.addImportScopes
|
||||
import org.jetbrains.kotlin.resolve.scopes.utils.addImportingScopes
|
||||
import org.jetbrains.kotlin.types.TypeUtils
|
||||
import org.jetbrains.kotlin.types.expressions.ExpressionTypingServices
|
||||
import org.jetbrains.kotlin.types.expressions.PreliminaryDeclarationVisitor
|
||||
@@ -142,6 +142,6 @@ public class CodeFragmentAnalyzer(
|
||||
qualifierResolver.processImportReference(it, resolveSession.moduleDescriptor, resolveSession.trace, null)
|
||||
}.filterNotNull()
|
||||
|
||||
return scopeForContextElement.addImportScopes(importScopes) to dataFlowInfo
|
||||
return scopeForContextElement.addImportingScopes(importScopes) to dataFlowInfo
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user