Replaced filterIsInstance with class-literal argument with simplified version

This commit is contained in:
Denis Zharkov
2014-11-13 11:24:09 +04:00
parent c9c16696f1
commit 8b80daa2a1
20 changed files with 24 additions and 24 deletions
@@ -23,12 +23,12 @@ import org.jetbrains.jet.lang.resolve.name.Name
public class InnerClassesScopeWrapper(override val workerScope: JetScope) : AbstractScopeAdapter() {
override fun getClassifier(name: Name) = workerScope.getClassifier(name) as? ClassDescriptor
override fun getDeclarationsByLabel(labelName: Name) = workerScope.getDeclarationsByLabel(labelName).filterIsInstance(javaClass<ClassDescriptor>())
override fun getDeclarationsByLabel(labelName: Name) = workerScope.getDeclarationsByLabel(labelName).filterIsInstance<ClassDescriptor>()
override fun getDescriptors(kindFilter: DescriptorKindFilter,
nameFilter: (Name) -> Boolean): List<ClassDescriptor> {
val restrictedFilter = kindFilter.restrictedToKinds(DescriptorKindFilter.CLASSIFIERS_MASK) ?: return listOf()
return workerScope.getDescriptors(restrictedFilter, nameFilter).filterIsInstance(javaClass<ClassDescriptor>())
return workerScope.getDescriptors(restrictedFilter, nameFilter).filterIsInstance<ClassDescriptor>()
}
override fun getImplicitReceiversHierarchy(): List<ReceiverParameterDescriptor> = listOf()