Removed unused methods from KtScope.

This commit is contained in:
Stanislav Erokhin
2015-10-31 09:24:22 +03:00
parent cc56cf6292
commit 7cd667c0e3
13 changed files with 8 additions and 260 deletions
@@ -28,7 +28,6 @@ import org.jetbrains.kotlin.resolve.DescriptorFactory
import org.jetbrains.kotlin.resolve.calls.tasks.collectors.CallableDescriptorCollector
import org.jetbrains.kotlin.resolve.calls.tasks.collectors.CallableDescriptorCollectors
import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns
import org.jetbrains.kotlin.resolve.scopes.KtScope
import org.jetbrains.kotlin.resolve.scopes.KtScopeImpl
import org.jetbrains.kotlin.resolve.scopes.LexicalScope
import org.jetbrains.kotlin.resolve.scopes.receivers.TransientReceiver
@@ -19,14 +19,16 @@ package org.jetbrains.kotlin.load.java.lazy.descriptors
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.annotations.Annotations
import org.jetbrains.kotlin.descriptors.impl.*
import org.jetbrains.kotlin.descriptors.impl.ConstructorDescriptorImpl
import org.jetbrains.kotlin.descriptors.impl.EnumEntrySyntheticClassDescriptor
import org.jetbrains.kotlin.descriptors.impl.ValueParameterDescriptorImpl
import org.jetbrains.kotlin.incremental.components.LookupLocation
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
import org.jetbrains.kotlin.load.java.*
import org.jetbrains.kotlin.load.java.BuiltinSpecialProperties.getBuiltinSpecialPropertyGetterName
import org.jetbrains.kotlin.load.java.BuiltinMethodsWithDifferentJvmName.sameAsRenamedInJvmBuiltin
import org.jetbrains.kotlin.load.java.BuiltinMethodsWithDifferentJvmName.isRemoveAtByIndex
import org.jetbrains.kotlin.load.java.BuiltinMethodsWithDifferentJvmName.sameAsRenamedInJvmBuiltin
import org.jetbrains.kotlin.load.java.BuiltinMethodsWithSpecialGenericSignature.sameAsBuiltinMethodWithErasedValueParameters
import org.jetbrains.kotlin.load.java.BuiltinSpecialProperties.getBuiltinSpecialPropertyGetterName
import org.jetbrains.kotlin.load.java.components.DescriptorResolverUtils
import org.jetbrains.kotlin.load.java.components.TypeUsage
import org.jetbrains.kotlin.load.java.descriptors.JavaConstructorDescriptor
@@ -38,7 +40,6 @@ import org.jetbrains.kotlin.load.java.lazy.child
import org.jetbrains.kotlin.load.java.lazy.resolveAnnotations
import org.jetbrains.kotlin.load.java.lazy.types.RawSubstitution
import org.jetbrains.kotlin.load.java.lazy.types.toAttributes
import org.jetbrains.kotlin.load.java.sources.JavaSourceElement
import org.jetbrains.kotlin.load.java.structure.JavaArrayType
import org.jetbrains.kotlin.load.java.structure.JavaClass
import org.jetbrains.kotlin.load.java.structure.JavaConstructor
@@ -630,10 +631,6 @@ public class LazyJavaClassMemberScope(
}
}
// TODO
override fun getImplicitReceiversHierarchy(): List<ReceiverParameterDescriptor> = listOf()
override fun getContainingDeclaration() = super.getContainingDeclaration() as ClassDescriptor
// namespaces should be resolved elsewhere
@@ -18,7 +18,6 @@ package org.jetbrains.kotlin.load.java.lazy.descriptors
import org.jetbrains.kotlin.descriptors.ClassOrPackageFragmentDescriptor
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
import org.jetbrains.kotlin.descriptors.ReceiverParameterDescriptor
import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor
import org.jetbrains.kotlin.load.java.lazy.LazyJavaResolverContext
import org.jetbrains.kotlin.load.java.structure.JavaMethod
@@ -37,8 +36,6 @@ public abstract class LazyJavaStaticScope(
override fun getPackage(name: Name) = null
abstract fun getSubPackages(): Collection<FqName>
override fun getImplicitReceiversHierarchy(): List<ReceiverParameterDescriptor> = listOf()
override fun resolveMethodSignature(
method: JavaMethod, methodTypeParameters: List<TypeParameterDescriptor>, returnType: KotlinType,
valueParameters: LazyJavaScope.ResolvedValueParameters
@@ -19,7 +19,6 @@ package org.jetbrains.kotlin.resolve.scopes
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.incremental.components.LookupLocation
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.utils.Printer
/**
@@ -34,10 +33,6 @@ public abstract class AbstractScopeAdapter : KtScope {
else
workerScope
override fun getImplicitReceiversHierarchy(): List<ReceiverParameterDescriptor> {
return workerScope.getImplicitReceiversHierarchy()
}
override fun getFunctions(name: Name, location: LookupLocation): Collection<FunctionDescriptor> {
return workerScope.getFunctions(name, location)
}
@@ -54,34 +49,10 @@ public abstract class AbstractScopeAdapter : KtScope {
return workerScope.getProperties(name, location)
}
override fun getSyntheticExtensionProperties(receiverTypes: Collection<KotlinType>, name: Name, location: LookupLocation): Collection<PropertyDescriptor> {
return workerScope.getSyntheticExtensionProperties(receiverTypes, name, location)
}
override fun getSyntheticExtensionFunctions(receiverTypes: Collection<KotlinType>, name: Name, location: LookupLocation): Collection<FunctionDescriptor> {
return workerScope.getSyntheticExtensionFunctions(receiverTypes, name, location)
}
override fun getSyntheticExtensionProperties(receiverTypes: Collection<KotlinType>): Collection<PropertyDescriptor> {
return workerScope.getSyntheticExtensionProperties(receiverTypes)
}
override fun getSyntheticExtensionFunctions(receiverTypes: Collection<KotlinType>): Collection<FunctionDescriptor> {
return workerScope.getSyntheticExtensionFunctions(receiverTypes)
}
override fun getLocalVariable(name: Name): VariableDescriptor? {
return workerScope.getLocalVariable(name)
}
override fun getContainingDeclaration(): DeclarationDescriptor {
return workerScope.getContainingDeclaration()
}
override fun getDeclarationsByLabel(labelName: Name): Collection<DeclarationDescriptor> {
return workerScope.getDeclarationsByLabel(labelName)
}
override fun getDescriptors(kindFilter: DescriptorKindFilter,
nameFilter: (Name) -> Boolean): Collection<DeclarationDescriptor> {
return workerScope.getDescriptors(kindFilter, nameFilter)
@@ -19,11 +19,9 @@ package org.jetbrains.kotlin.resolve.scopes
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.incremental.components.LookupLocation
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.util.collectionUtils.getFirstMatch
import org.jetbrains.kotlin.util.collectionUtils.getFromAllScopes
import org.jetbrains.kotlin.utils.Printer
import java.util.ArrayList
public open class ChainedScope(
private val containingDeclaration: DeclarationDescriptor?/* it's nullable as a hack for TypeUtils.intersect() */,
@@ -31,7 +29,6 @@ public open class ChainedScope(
vararg scopes: KtScope
) : KtScope {
private val scopeChain = scopes.clone()
private var implicitReceiverHierarchy: List<ReceiverParameterDescriptor>? = null
override fun getClassifier(name: Name, location: LookupLocation): ClassifierDescriptor?
= getFirstMatch(scopeChain) { it.getClassifier(name, location) }
@@ -42,38 +39,11 @@ public open class ChainedScope(
override fun getProperties(name: Name, location: LookupLocation): Collection<VariableDescriptor>
= getFromAllScopes(scopeChain) { it.getProperties(name, location) }
override fun getLocalVariable(name: Name): VariableDescriptor?
= getFirstMatch(scopeChain) { it.getLocalVariable(name) }
override fun getFunctions(name: Name, location: LookupLocation): Collection<FunctionDescriptor>
= getFromAllScopes(scopeChain) { it.getFunctions(name, location) }
override fun getSyntheticExtensionProperties(receiverTypes: Collection<KotlinType>, name: Name, location: LookupLocation): Collection<PropertyDescriptor>
= getFromAllScopes(scopeChain) { it.getSyntheticExtensionProperties(receiverTypes, name, location) }
override fun getSyntheticExtensionFunctions(receiverTypes: Collection<KotlinType>, name: Name, location: LookupLocation): Collection<FunctionDescriptor>
= getFromAllScopes(scopeChain) { it.getSyntheticExtensionFunctions(receiverTypes, name, location) }
override fun getSyntheticExtensionProperties(receiverTypes: Collection<KotlinType>): Collection<PropertyDescriptor>
= getFromAllScopes(scopeChain) { it.getSyntheticExtensionProperties(receiverTypes) }
override fun getSyntheticExtensionFunctions(receiverTypes: Collection<KotlinType>): Collection<FunctionDescriptor>
= getFromAllScopes(scopeChain) { it.getSyntheticExtensionFunctions(receiverTypes) }
override fun getImplicitReceiversHierarchy(): List<ReceiverParameterDescriptor> {
if (implicitReceiverHierarchy == null) {
val result = ArrayList<ReceiverParameterDescriptor>()
scopeChain.flatMapTo(result) { it.getImplicitReceiversHierarchy() }
result.trimToSize()
implicitReceiverHierarchy = result
}
return implicitReceiverHierarchy!!
}
override fun getContainingDeclaration(): DeclarationDescriptor = containingDeclaration!!
override fun getDeclarationsByLabel(labelName: Name) = scopeChain.flatMap { it.getDeclarationsByLabel(labelName) }
override fun getDescriptors(kindFilter: DescriptorKindFilter, nameFilter: (Name) -> Boolean)
= getFromAllScopes(scopeChain) { it.getDescriptors(kindFilter, nameFilter) }
@@ -17,11 +17,8 @@
package org.jetbrains.kotlin.resolve.scopes
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
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.types.KotlinType
import org.jetbrains.kotlin.utils.Printer
public class FilteringScope(private val workerScope: KtScope, private val predicate: (DeclarationDescriptor) -> Boolean) : KtScope {
@@ -39,27 +36,9 @@ public class FilteringScope(private val workerScope: KtScope, private val predic
override fun getProperties(name: Name, location: LookupLocation) = workerScope.getProperties(name, location).filter(predicate)
override fun getSyntheticExtensionProperties(receiverTypes: Collection<KotlinType>, name: Name, location: LookupLocation): Collection<PropertyDescriptor>
= workerScope.getSyntheticExtensionProperties(receiverTypes, name, location).filter(predicate)
override fun getSyntheticExtensionFunctions(receiverTypes: Collection<KotlinType>, name: Name, location: LookupLocation): Collection<FunctionDescriptor>
= workerScope.getSyntheticExtensionFunctions(receiverTypes, name, location).filter(predicate)
override fun getSyntheticExtensionProperties(receiverTypes: Collection<KotlinType>): Collection<PropertyDescriptor>
= workerScope.getSyntheticExtensionProperties(receiverTypes).filter(predicate)
override fun getSyntheticExtensionFunctions(receiverTypes: Collection<KotlinType>): Collection<FunctionDescriptor>
= workerScope.getSyntheticExtensionFunctions(receiverTypes).filter(predicate)
override fun getLocalVariable(name: Name) = filterDescriptor(workerScope.getLocalVariable(name))
override fun getDescriptors(kindFilter: DescriptorKindFilter,
nameFilter: (Name) -> Boolean) = workerScope.getDescriptors(kindFilter, nameFilter).filter(predicate)
override fun getImplicitReceiversHierarchy() = workerScope.getImplicitReceiversHierarchy()
override fun getDeclarationsByLabel(labelName: Name) = workerScope.getDeclarationsByLabel(labelName).filter(predicate)
override fun getOwnDeclaredDescriptors() = workerScope.getOwnDeclaredDescriptors().filter(predicate)
override fun printScopeStructure(p: Printer) {
@@ -19,7 +19,6 @@ package org.jetbrains.kotlin.resolve.scopes
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.incremental.components.LookupLocation
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.utils.Printer
import org.jetbrains.kotlin.utils.toReadOnlyList
import java.lang.reflect.Modifier
@@ -28,24 +27,15 @@ public interface KtScope {
public fun getClassifier(name: Name, location: LookupLocation): ClassifierDescriptor?
@Deprecated("Should be removed soon")
public fun getPackage(name: Name): PackageViewDescriptor?
public fun getProperties(name: Name, location: LookupLocation): Collection<VariableDescriptor>
public fun getLocalVariable(name: Name): VariableDescriptor?
public fun getFunctions(name: Name, location: LookupLocation): Collection<FunctionDescriptor>
public fun getSyntheticExtensionProperties(receiverTypes: Collection<KotlinType>, name: Name, location: LookupLocation): Collection<PropertyDescriptor>
public fun getSyntheticExtensionFunctions(receiverTypes: Collection<KotlinType>, name: Name, location: LookupLocation): Collection<FunctionDescriptor>
public fun getSyntheticExtensionProperties(receiverTypes: Collection<KotlinType>): Collection<PropertyDescriptor>
public fun getSyntheticExtensionFunctions(receiverTypes: Collection<KotlinType>): Collection<FunctionDescriptor>
public fun getContainingDeclaration(): DeclarationDescriptor
public fun getDeclarationsByLabel(labelName: Name): Collection<DeclarationDescriptor>
/**
* All visible descriptors from current scope.
*
@@ -62,11 +52,7 @@ public interface KtScope {
nameFilter: (Name) -> Boolean = ALL_NAME_FILTER
): Collection<DeclarationDescriptor>
/**
* Adds receivers to the list in order of locality, so that the closest (the most local) receiver goes first
*/
public fun getImplicitReceiversHierarchy(): List<ReceiverParameterDescriptor>
// todo merge with getAllDescriptors()
public fun getOwnDeclaredDescriptors(): Collection<DeclarationDescriptor>
/**
@@ -19,7 +19,6 @@ package org.jetbrains.kotlin.resolve.scopes
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.incremental.components.LookupLocation
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.utils.Printer
abstract class KtScopeImpl : KtScope {
@@ -27,25 +26,13 @@ abstract class KtScopeImpl : KtScope {
override fun getProperties(name: Name, location: LookupLocation): Collection<VariableDescriptor> = emptyList()
override fun getLocalVariable(name: Name): VariableDescriptor? = null
override fun getPackage(name: Name): PackageViewDescriptor? = null
override fun getFunctions(name: Name, location: LookupLocation): Collection<FunctionDescriptor> = emptyList()
override fun getSyntheticExtensionProperties(receiverTypes: Collection<KotlinType>, name: Name, location: LookupLocation): Collection<PropertyDescriptor> = emptyList()
override fun getSyntheticExtensionFunctions(receiverTypes: Collection<KotlinType>, name: Name, location: LookupLocation): Collection<FunctionDescriptor> = emptyList()
override fun getSyntheticExtensionProperties(receiverTypes: Collection<KotlinType>): Collection<PropertyDescriptor> = emptyList()
override fun getSyntheticExtensionFunctions(receiverTypes: Collection<KotlinType>): Collection<FunctionDescriptor> = emptyList()
override fun getDeclarationsByLabel(labelName: Name): Collection<DeclarationDescriptor> = emptyList()
override fun getDescriptors(kindFilter: DescriptorKindFilter,
nameFilter: (Name) -> Boolean): Collection<DeclarationDescriptor> = emptyList()
override fun getImplicitReceiversHierarchy(): List<ReceiverParameterDescriptor> = emptyList()
override fun getOwnDeclaredDescriptors(): Collection<DeclarationDescriptor> = emptyList()
// This method should not be implemented here by default: every scope class has its unique structure pattern
@@ -17,16 +17,12 @@
package org.jetbrains.kotlin.resolve.scopes
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
import org.jetbrains.kotlin.descriptors.ReceiverParameterDescriptor
import org.jetbrains.kotlin.incremental.components.LookupLocation
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.TypeSubstitutor
import org.jetbrains.kotlin.utils.Printer
import org.jetbrains.kotlin.utils.newHashSetWithExpectedSize
import java.util.HashMap
import java.util.*
public class SubstitutingScope(private val workerScope: KtScope, private val substitutor: TypeSubstitutor) : KtScope {
@@ -65,36 +61,14 @@ public class SubstitutingScope(private val workerScope: KtScope, private val sub
override fun getProperties(name: Name, location: LookupLocation) = substitute(workerScope.getProperties(name, location))
override fun getLocalVariable(name: Name) = substitute(workerScope.getLocalVariable(name))
override fun getClassifier(name: Name, location: LookupLocation) = substitute(workerScope.getClassifier(name, location))
override fun getFunctions(name: Name, location: LookupLocation) = substitute(workerScope.getFunctions(name, location))
override fun getSyntheticExtensionProperties(receiverTypes: Collection<KotlinType>, name: Name, location: LookupLocation): Collection<PropertyDescriptor>
= substitute(workerScope.getSyntheticExtensionProperties(receiverTypes, name, location))
override fun getSyntheticExtensionFunctions(receiverTypes: Collection<KotlinType>, name: Name, location: LookupLocation): Collection<FunctionDescriptor>
= substitute(workerScope.getSyntheticExtensionFunctions(receiverTypes, name, location))
override fun getSyntheticExtensionProperties(receiverTypes: Collection<KotlinType>): Collection<PropertyDescriptor>
= substitute(workerScope.getSyntheticExtensionProperties(receiverTypes))
override fun getSyntheticExtensionFunctions(receiverTypes: Collection<KotlinType>): Collection<FunctionDescriptor>
= substitute(workerScope.getSyntheticExtensionFunctions(receiverTypes))
override fun getPackage(name: Name) = workerScope.getPackage(name)
override fun getImplicitReceiversHierarchy(): List<ReceiverParameterDescriptor> {
throw UnsupportedOperationException() // TODO
}
override fun getContainingDeclaration() = workerScope.getContainingDeclaration()
override fun getDeclarationsByLabel(labelName: Name): Collection<DeclarationDescriptor> {
throw UnsupportedOperationException() // TODO
}
override fun getDescriptors(kindFilter: DescriptorKindFilter,
nameFilter: (Name) -> Boolean) = _allDescriptors
@@ -179,54 +179,11 @@ public class ErrorUtils {
return ERROR_VARIABLE_GROUP;
}
@NotNull
@Override
public Collection<PropertyDescriptor> getSyntheticExtensionProperties(
@NotNull Collection<? extends KotlinType> receiverTypes, @NotNull Name name,
@NotNull LookupLocation location
) {
return ERROR_PROPERTY_GROUP;
}
@NotNull
@Override
public Collection<FunctionDescriptor> getSyntheticExtensionFunctions(
@NotNull Collection<? extends KotlinType> receiverTypes, @NotNull Name name,
@NotNull LookupLocation location
) {
return Collections.<FunctionDescriptor>singleton(createErrorFunction(this));
}
@NotNull
@Override
public Collection<PropertyDescriptor> getSyntheticExtensionProperties(@NotNull Collection<? extends KotlinType> receiverTypes) {
return ERROR_PROPERTY_GROUP;
}
@NotNull
@Override
public Collection<FunctionDescriptor> getSyntheticExtensionFunctions(
@NotNull Collection<? extends KotlinType> receiverTypes
) {
return Collections.<FunctionDescriptor>singleton(createErrorFunction(this));
}
@Override
public VariableDescriptor getLocalVariable(@NotNull Name name) {
return ERROR_PROPERTY;
}
@Override
public PackageViewDescriptor getPackage(@NotNull Name name) {
return null;
}
@NotNull
@Override
public List<ReceiverParameterDescriptor> getImplicitReceiversHierarchy() {
return Collections.emptyList();
}
@NotNull
@Override
public Set<FunctionDescriptor> getFunctions(@NotNull Name name, @NotNull LookupLocation location) {
@@ -239,12 +196,6 @@ public class ErrorUtils {
return ERROR_MODULE;
}
@NotNull
@Override
public Collection<DeclarationDescriptor> getDeclarationsByLabel(@NotNull Name labelName) {
return Collections.emptyList();
}
@NotNull
@Override
public Collection<DeclarationDescriptor> getDescriptors(
@@ -301,62 +252,18 @@ public class ErrorUtils {
throw new IllegalStateException();
}
@Nullable
@Override
public VariableDescriptor getLocalVariable(@NotNull Name name) {
throw new IllegalStateException();
}
@NotNull
@Override
public Collection<FunctionDescriptor> getFunctions(@NotNull Name name, @NotNull LookupLocation location) {
throw new IllegalStateException();
}
@NotNull
@Override
public Collection<PropertyDescriptor> getSyntheticExtensionProperties(
@NotNull Collection<? extends KotlinType> receiverTypes, @NotNull Name name,
@NotNull LookupLocation location
) {
throw new IllegalStateException();
}
@NotNull
@Override
public Collection<FunctionDescriptor> getSyntheticExtensionFunctions(
@NotNull Collection<? extends KotlinType> receiverTypes, @NotNull Name name,
@NotNull LookupLocation location
) {
throw new IllegalStateException();
}
@NotNull
@Override
public Collection<PropertyDescriptor> getSyntheticExtensionProperties(@NotNull Collection<? extends KotlinType> receiverTypes) {
throw new IllegalStateException();
}
@NotNull
@Override
public Collection<FunctionDescriptor> getSyntheticExtensionFunctions(
@NotNull Collection<? extends KotlinType> receiverTypes
) {
throw new IllegalStateException();
}
@NotNull
@Override
public DeclarationDescriptor getContainingDeclaration() {
return ERROR_MODULE;
}
@NotNull
@Override
public Collection<DeclarationDescriptor> getDeclarationsByLabel(@NotNull Name labelName) {
throw new IllegalStateException();
}
@NotNull
@Override
public Collection<DeclarationDescriptor> getDescriptors(
@@ -371,12 +278,6 @@ public class ErrorUtils {
throw new IllegalStateException();
}
@NotNull
@Override
public List<ReceiverParameterDescriptor> getImplicitReceiversHierarchy() {
throw new IllegalStateException();
}
@NotNull
@Override
public Collection<DeclarationDescriptor> getOwnDeclaredDescriptors() {
@@ -461,7 +362,6 @@ public class ErrorUtils {
private static final PropertyDescriptor ERROR_PROPERTY = createErrorProperty();
private static final Set<VariableDescriptor> ERROR_VARIABLE_GROUP = Collections.<VariableDescriptor>singleton(ERROR_PROPERTY);
private static final Set<PropertyDescriptor> ERROR_PROPERTY_GROUP = Collections.singleton(ERROR_PROPERTY);
@NotNull
private static PropertyDescriptorImpl createErrorProperty() {
@@ -242,8 +242,6 @@ public class DeserializedClassDescriptor(
}
}
override fun getImplicitReceiver() = classDescriptor.getThisAsReceiverParameter()
override fun getClassDescriptor(name: Name): ClassifierDescriptor? =
classDescriptor.enumEntries.findEnumEntry(name) ?: classDescriptor.nestedClasses.findNestedClass(name)
@@ -175,13 +175,6 @@ public abstract class DeserializedMemberScope protected constructor(
protected abstract fun addEnumEntryDescriptors(result: MutableCollection<DeclarationDescriptor>, nameFilter: (Name) -> Boolean)
override fun getImplicitReceiversHierarchy(): List<ReceiverParameterDescriptor> {
val receiver = getImplicitReceiver()
return if (receiver != null) listOf(receiver) else listOf()
}
protected abstract fun getImplicitReceiver(): ReceiverParameterDescriptor?
override fun getOwnDeclaredDescriptors() = getAllDescriptors()
override fun printScopeStructure(p: Printer) {
@@ -19,7 +19,6 @@ package org.jetbrains.kotlin.serialization.deserialization.descriptors
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor
import org.jetbrains.kotlin.descriptors.ReceiverParameterDescriptor
import org.jetbrains.kotlin.incremental.components.LookupLocation
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
import org.jetbrains.kotlin.name.ClassId
@@ -69,6 +68,4 @@ public open class DeserializedPackageMemberScope(
override fun addEnumEntryDescriptors(result: MutableCollection<DeclarationDescriptor>, nameFilter: (Name) -> Boolean) {
// Do nothing
}
override fun getImplicitReceiver(): ReceiverParameterDescriptor? = null
}