Completion of object's in type position - they can be used there

This commit is contained in:
Valentin Kipyatkov
2014-12-05 08:05:23 +03:00
parent ca2b1efac9
commit cb5c12cda3
9 changed files with 37 additions and 28 deletions
@@ -185,17 +185,20 @@ public class DescriptorKindFilter(
public trait DescriptorKindExclude {
public fun matches(descriptor: DeclarationDescriptor): Boolean
override fun toString() = this.javaClass.getSimpleName()
public object Extensions : DescriptorKindExclude {
override fun matches(descriptor: DeclarationDescriptor)
= descriptor is CallableDescriptor && descriptor.getExtensionReceiverParameter() != null
override fun toString() = this.javaClass.getSimpleName()
}
public object NonExtensions : DescriptorKindExclude {
override fun matches(descriptor: DeclarationDescriptor)
= descriptor !is CallableDescriptor || descriptor.getExtensionReceiverParameter() == null
}
override fun toString() = this.javaClass.getSimpleName()
public object EnumEntry : DescriptorKindExclude {
override fun matches(descriptor: DeclarationDescriptor)
= descriptor is ClassDescriptor && descriptor.getKind() == ClassKind.ENUM_ENTRY
}
}