Minor, inline LexicalScope.Companion.empty
This commit is contained in:
@@ -113,7 +113,7 @@ class FileScopeFactory(
|
||||
|
||||
val importingScope = LazyImportScope(scope, explicitImportResolver, LazyImportScope.FilteringKind.ALL, "Explicit imports in $debugName")
|
||||
|
||||
val lexicalScope = LexicalScope.empty(importingScope, packageFragment)
|
||||
val lexicalScope = LexicalScope.Empty(importingScope, packageFragment)
|
||||
|
||||
val importResolver = object : ImportResolver {
|
||||
override fun forceResolveAllImports() {
|
||||
|
||||
+4
-3
@@ -60,7 +60,7 @@ class LazyAnnotations(
|
||||
entry: KtAnnotationEntry ->
|
||||
|
||||
val descriptor = LazyAnnotationDescriptor(c, entry)
|
||||
val target = entry.getUseSiteTarget()?.getAnnotationUseSiteTarget()
|
||||
val target = entry.useSiteTarget?.getAnnotationUseSiteTarget()
|
||||
AnnotationWithTarget(descriptor, target)
|
||||
}
|
||||
|
||||
@@ -132,8 +132,9 @@ class LazyAnnotationDescriptor(
|
||||
private val source = annotationEntry.toSourceElement()
|
||||
|
||||
val scope = if (c.scope.ownerDescriptor is PackageFragmentDescriptor) {
|
||||
LexicalScope.Companion.empty(c.scope, FileDescriptorForVisibilityChecks(source, c.scope.ownerDescriptor))
|
||||
} else {
|
||||
LexicalScope.Empty(c.scope, FileDescriptorForVisibilityChecks(source, c.scope.ownerDescriptor))
|
||||
}
|
||||
else {
|
||||
c.scope
|
||||
}
|
||||
|
||||
|
||||
@@ -59,10 +59,6 @@ interface LexicalScope: HierarchicalScope {
|
||||
p.println("Empty lexical scope with owner = $ownerDescriptor and parent = $parent")
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun empty(parent: HierarchicalScope, ownerDescriptor: DeclarationDescriptor): LexicalScope = Empty(parent, ownerDescriptor)
|
||||
}
|
||||
}
|
||||
|
||||
enum class LexicalScopeKind(val withLocalDescriptors: Boolean) {
|
||||
|
||||
@@ -21,4 +21,4 @@ import org.jetbrains.kotlin.resolve.scopes.LexicalScope
|
||||
import org.jetbrains.kotlin.resolve.scopes.utils.memberScopeAsImportingScope
|
||||
|
||||
fun KotlinBuiltIns.builtInPackageAsLexicalScope()
|
||||
= LexicalScope.empty(builtInsPackageScope.memberScopeAsImportingScope(), builtInsModule)
|
||||
= LexicalScope.Empty(builtInsPackageScope.memberScopeAsImportingScope(), builtInsModule)
|
||||
|
||||
Reference in New Issue
Block a user