ChainedScope -> ChainedMemberScope
This commit is contained in:
+2
-2
@@ -23,7 +23,7 @@ import org.jetbrains.kotlin.descriptors.ClassDescriptor;
|
||||
import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor;
|
||||
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader;
|
||||
import org.jetbrains.kotlin.name.Name;
|
||||
import org.jetbrains.kotlin.resolve.scopes.ChainedScope;
|
||||
import org.jetbrains.kotlin.resolve.scopes.ChainedMemberScope;
|
||||
import org.jetbrains.kotlin.resolve.scopes.MemberScope;
|
||||
import org.jetbrains.kotlin.serialization.ClassData;
|
||||
import org.jetbrains.kotlin.serialization.ClassDataWithSource;
|
||||
@@ -108,7 +108,7 @@ public final class DeserializedDescriptorResolver {
|
||||
if (list.isEmpty()) {
|
||||
return MemberScope.Empty.INSTANCE;
|
||||
}
|
||||
return new ChainedScope("Member scope for union of package parts data", list.toArray(new MemberScope[list.size()]));
|
||||
return new ChainedMemberScope("Member scope for union of package parts data", list.toArray(new MemberScope[list.size()]));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@ import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.PackageViewDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.resolve.scopes.ChainedScope
|
||||
import org.jetbrains.kotlin.resolve.scopes.ChainedMemberScope
|
||||
import org.jetbrains.kotlin.resolve.scopes.MemberScope
|
||||
import org.jetbrains.kotlin.resolve.scopes.LazyScopeAdapter
|
||||
import org.jetbrains.kotlin.storage.StorageManager
|
||||
@@ -46,7 +46,7 @@ public class LazyPackageViewDescriptorImpl(
|
||||
else {
|
||||
// Packages from SubpackagesScope are got via getContributedDescriptors(DescriptorKindFilter.PACKAGES, MemberScope.ALL_NAME_FILTER)
|
||||
val scopes = fragments.map { it.getMemberScope() } + SubpackagesScope(module, fqName)
|
||||
ChainedScope("package view scope for $fqName in ${module.getName()}", *scopes.toTypedArray())
|
||||
ChainedMemberScope("package view scope for $fqName in ${module.getName()}", *scopes.toTypedArray())
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
+4
-2
@@ -16,14 +16,16 @@
|
||||
|
||||
package org.jetbrains.kotlin.resolve.scopes
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.descriptors.ClassifierDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
|
||||
import org.jetbrains.kotlin.incremental.components.LookupLocation
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.util.collectionUtils.getFirstMatch
|
||||
import org.jetbrains.kotlin.util.collectionUtils.getFromAllScopes
|
||||
import org.jetbrains.kotlin.utils.Printer
|
||||
|
||||
public class ChainedScope(
|
||||
public class ChainedMemberScope(
|
||||
internal val debugName: String,
|
||||
vararg scopes: MemberScope
|
||||
) : MemberScope {
|
||||
@@ -16,14 +16,15 @@
|
||||
|
||||
package org.jetbrains.kotlin.resolve.scopes
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.descriptors.CallableDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
||||
import org.jetbrains.kotlin.incremental.components.LookupLocation
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.selectMostSpecificInEachOverridableGroup
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.utils.Printer
|
||||
|
||||
class TypeIntersectionScope private constructor(override val workerScope: ChainedScope) : AbstractScopeAdapter() {
|
||||
class TypeIntersectionScope private constructor(override val workerScope: ChainedMemberScope) : AbstractScopeAdapter() {
|
||||
override fun getContributedFunctions(name: Name, location: LookupLocation) =
|
||||
super.getContributedFunctions(name, location).selectMostSpecificInEachOverridableGroup { this }
|
||||
|
||||
@@ -45,7 +46,7 @@ class TypeIntersectionScope private constructor(override val workerScope: Chaine
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun create(message: String, types: List<KotlinType>): MemberScope {
|
||||
val chainedScope = ChainedScope(message, *types.map { it.memberScope }.toTypedArray())
|
||||
val chainedScope = ChainedMemberScope(message, *types.map { it.memberScope }.toTypedArray())
|
||||
if (types.size <= 1) return chainedScope
|
||||
|
||||
return TypeIntersectionScope(chainedScope)
|
||||
|
||||
Reference in New Issue
Block a user