Revert "Add missing definitelyDoesNotContainName methods"
This reverts commit b74692e9
This commit is contained in:
-33
@@ -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>
|
||||
|
||||
@@ -91,10 +91,6 @@ class LexicalChainedScope private constructor(
|
||||
p.println("}")
|
||||
}
|
||||
|
||||
override fun definitelyDoesNotContainName(name: Name): Boolean {
|
||||
return memberScopes.all { it.definitelyDoesNotContainName(name) }
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@JvmOverloads
|
||||
|
||||
@@ -46,8 +46,6 @@ interface MemberScope : ResolutionScope {
|
||||
p.println("Empty member scope")
|
||||
}
|
||||
|
||||
override fun definitelyDoesNotContainName(name: Name): Boolean = true
|
||||
|
||||
override fun getFunctionNames() = emptySet<Name>()
|
||||
override fun getVariableNames() = emptySet<Name>()
|
||||
override fun getClassifierNames() = emptySet<Name>()
|
||||
|
||||
Reference in New Issue
Block a user