Use nameFilter if all descriptors have not calculated
#KT-49821 Fixed
This commit is contained in:
committed by
teamcityserver
parent
bfa3f89aeb
commit
42837415f0
@@ -19,6 +19,7 @@ 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.resolve.scopes.MemberScope.Companion.ALL_NAME_FILTER
|
||||
import org.jetbrains.kotlin.utils.Printer
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.flatMapToNullable
|
||||
import java.lang.reflect.Modifier
|
||||
@@ -73,7 +74,7 @@ fun Iterable<MemberScope>.flatMapClassifierNamesOrNull(): MutableSet<Name>? =
|
||||
*/
|
||||
fun MemberScope.getDescriptorsFiltered(
|
||||
kindFilter: DescriptorKindFilter = DescriptorKindFilter.ALL,
|
||||
nameFilter: (Name) -> Boolean = { true }
|
||||
nameFilter: (Name) -> Boolean = ALL_NAME_FILTER
|
||||
): Collection<DeclarationDescriptor> {
|
||||
if (kindFilter.kindMask == 0) return listOf()
|
||||
return getContributedDescriptors(kindFilter, nameFilter).filter { kindFilter.accepts(it) && nameFilter(it.name) }
|
||||
|
||||
Reference in New Issue
Block a user