Introduce ResolutionScope::definitelyDoesNotContainName
Also add some obvious implementations This method might be used in resolution to filter out inapplicable scopes
This commit is contained in:
@@ -124,4 +124,7 @@ abstract class LexicalScopeStorage(
|
||||
} while (rest != null)
|
||||
return result
|
||||
}
|
||||
|
||||
override fun definitelyDoesNotContainName(name: Name) =
|
||||
functionsByName?.get(name) == null && variablesAndClassifiersByName?.get(name) == null
|
||||
}
|
||||
|
||||
@@ -55,6 +55,8 @@ interface LexicalScope : HierarchicalScope {
|
||||
override val kind: LexicalScopeKind
|
||||
get() = LexicalScopeKind.EMPTY
|
||||
|
||||
override fun definitelyDoesNotContainName(name: Name) = true
|
||||
|
||||
override fun printStructure(p: Printer) {
|
||||
p.println("Base lexical scope with owner = $ownerDescriptor and parent = $parent")
|
||||
}
|
||||
@@ -123,6 +125,8 @@ interface ImportingScope : HierarchicalScope {
|
||||
override fun printStructure(p: Printer) {
|
||||
p.println("ImportingScope.Empty")
|
||||
}
|
||||
|
||||
override fun definitelyDoesNotContainName(name: Name) = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user