KT-41346 Move Implementation to DeserializedMemberScope

This commit is contained in:
Roman Golyshev
2020-09-17 18:32:23 +03:00
parent 5596bf33d8
commit b1097c49d3
@@ -37,23 +37,6 @@ import java.io.ByteArrayInputStream
import java.io.ByteArrayOutputStream
import kotlin.collections.ArrayList
private interface Implementation {
val functionNames: Set<Name>
val variableNames: Set<Name>
val typeAliasNames: Set<Name>
fun getContributedFunctions(name: Name, location: LookupLocation): Collection<SimpleFunctionDescriptor>
fun getContributedVariables(name: Name, location: LookupLocation): Collection<PropertyDescriptor>
fun getTypeAliasByName(name: Name): TypeAliasDescriptor?
fun addFunctionsAndPropertiesTo(
result: MutableCollection<DeclarationDescriptor>,
kindFilter: DescriptorKindFilter,
nameFilter: (Name) -> Boolean,
location: LookupLocation
)
}
abstract class DeserializedMemberScope protected constructor(
protected val c: DeserializationContext,
functionList: Collection<ProtoBuf.Function>,
@@ -77,7 +60,7 @@ abstract class DeserializedMemberScope protected constructor(
override fun getClassifierNames(): Set<Name>? = classifierNamesLazy
override fun definitelyDoesNotContainName(name: Name): Boolean {
return name !in impl.functionNames && name !in impl.variableNames && name !in classNames && name !in helper.typeAliasNames
return name !in impl.functionNames && name !in impl.variableNames && name !in classNames && name !in impl.typeAliasNames
}
/**
@@ -168,6 +151,23 @@ abstract class DeserializedMemberScope protected constructor(
p.println("}")
}
private interface Implementation {
val functionNames: Set<Name>
val variableNames: Set<Name>
val typeAliasNames: Set<Name>
fun getContributedFunctions(name: Name, location: LookupLocation): Collection<SimpleFunctionDescriptor>
fun getContributedVariables(name: Name, location: LookupLocation): Collection<PropertyDescriptor>
fun getTypeAliasByName(name: Name): TypeAliasDescriptor?
fun addFunctionsAndPropertiesTo(
result: MutableCollection<DeclarationDescriptor>,
kindFilter: DescriptorKindFilter,
nameFilter: (Name) -> Boolean,
location: LookupLocation
)
}
private inner class OptimizedImplementation(
functionList: Collection<ProtoBuf.Function>,
propertyList: Collection<ProtoBuf.Property>,