Revert "Add missing definitelyDoesNotContainName methods"

This reverts commit b74692e9
This commit is contained in:
Victor Petukhov
2020-06-17 13:16:16 +03:00
parent 447308dcfc
commit c0f4ee7dc9
3 changed files with 0 additions and 39 deletions
@@ -44,7 +44,6 @@ import org.jetbrains.kotlin.storage.getValue
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.checker.KotlinTypeRefiner
import org.jetbrains.kotlin.types.refinement.TypeRefinement
import org.jetbrains.kotlin.utils.addToStdlib.flatMapToNullable
import java.util.*
open class LazyClassMemberScope(
@@ -116,7 +115,6 @@ open class LazyClassMemberScope(
by lazy(LazyThreadSafetyMode.PUBLICATION) {
mutableSetOf<Name>().apply {
addAll(declarationProvider.getDeclarationNames())
addAll(c.syntheticResolveExtension.getSyntheticFunctionNames(thisDescriptor))
supertypes.flatMapTo(this) {
it.memberScope.getFunctionNames()
}
@@ -125,32 +123,6 @@ open class LazyClassMemberScope(
}
}
private val _classifierNames: Set<Name>?
by lazy(LazyThreadSafetyMode.PUBLICATION) {
mutableSetOf<Name>().apply {
supertypes.flatMapToNullable(this) {
it.memberScope.getClassifierNames()
} ?: return@lazy null
addAll(declarationProvider.getDeclarationNames())
with(c.syntheticResolveExtension) {
getSyntheticCompanionObjectNameIfNeeded(thisDescriptor)?.let { add(it) }
addAll(getSyntheticNestedClassNames(thisDescriptor))
}
}
}
private val _allNames: Set<Name>?
by lazy(LazyThreadSafetyMode.PUBLICATION) {
val classifiers = getClassifierNames() ?: return@lazy null
mutableSetOf<Name>().apply {
addAll(getVariableNames())
addAll(getFunctionNames())
addAll(classifiers)
}
}
private fun getDataClassRelatedFunctionNames(): Collection<Name> {
val declarations = mutableListOf<DeclarationDescriptor>()
addDataClassMethods(declarations, NoLookupLocation.WHEN_GET_ALL_DESCRIPTORS)
@@ -159,11 +131,6 @@ open class LazyClassMemberScope(
override fun getVariableNames() = _variableNames
override fun getFunctionNames() = _functionNames
override fun getClassifierNames() = _classifierNames
override fun definitelyDoesNotContainName(name: Name): Boolean {
return _allNames?.let { name !in it } ?: false
}
private interface MemberExtractor<out T : CallableMemberDescriptor> {
fun extract(extractFrom: KotlinType, name: Name): Collection<T>