This commit is contained in:
Valentin Kipyatkov
2014-11-12 18:59:34 +03:00
parent 25d8db37db
commit 8e992abe58
3 changed files with 5 additions and 8 deletions
@@ -44,6 +44,7 @@ import org.jetbrains.jet.lang.resolve.java.resolver.ExternalSignatureResolver
import org.jetbrains.jet.utils.* import org.jetbrains.jet.utils.*
import org.jetbrains.jet.lang.resolve.java.PLATFORM_TYPES import org.jetbrains.jet.lang.resolve.java.PLATFORM_TYPES
import org.jetbrains.jet.lang.descriptors.annotations.Annotations import org.jetbrains.jet.lang.descriptors.annotations.Annotations
import org.jetbrains.jet.lang.resolve.scopes.JetScope.DescriptorKindExclude.NonExtensions
public abstract class LazyJavaMemberScope( public abstract class LazyJavaMemberScope(
protected val c: LazyJavaResolverContextWithTypes, protected val c: LazyJavaResolverContextWithTypes,
@@ -309,7 +310,7 @@ public abstract class LazyJavaMemberScope(
} }
} }
if (kindFilter.acceptsKind(JetScope.FUNCTION) && !kindFilter.excludes.contains(JetScope.DescriptorKindExclude.NonExtensions)) { if (kindFilter.acceptsKind(JetScope.FUNCTION) && !kindFilter.excludes.contains(NonExtensions)) {
for (name in getFunctionNames(kindFilter, nameFilter)) { for (name in getFunctionNames(kindFilter, nameFilter)) {
if (nameFilter(name)) { if (nameFilter(name)) {
result.addAll(getFunctions(name)) result.addAll(getFunctions(name))
@@ -317,7 +318,7 @@ public abstract class LazyJavaMemberScope(
} }
} }
if (kindFilter.acceptsKind(JetScope.VARIABLE) && !kindFilter.excludes.contains(JetScope.DescriptorKindExclude.NonExtensions)) { if (kindFilter.acceptsKind(JetScope.VARIABLE) && !kindFilter.excludes.contains(NonExtensions)) {
for (name in getAllPropertyNames()) { for (name in getAllPropertyNames()) {
if (nameFilter(name)) { if (nameFilter(name)) {
result.addAll(getProperties(name)) result.addAll(getProperties(name))
@@ -91,7 +91,7 @@ public trait JetScope {
} }
} }
public data class KindFilter( public class KindFilter(
public val kindMask: Int, public val kindMask: Int,
public val excludes: List<DescriptorKindExclude> = listOf() public val excludes: List<DescriptorKindExclude> = listOf()
) { ) {
@@ -113,9 +113,6 @@ public trait JetScope {
return KindFilter(mask, excludes) return KindFilter(mask, excludes)
} }
public val isEmpty: Boolean
get() = kindMask == 0
class object { class object {
public val ALL: KindFilter = KindFilter(ALL_KINDS_MASK) public val ALL: KindFilter = KindFilter(ALL_KINDS_MASK)
public val CALLABLES: KindFilter = KindFilter(FUNCTION or VARIABLE) public val CALLABLES: KindFilter = KindFilter(FUNCTION or VARIABLE)
@@ -101,9 +101,8 @@ public object TipsManager{
val receiverValues = receivers.map { it.getValue() } val receiverValues = receivers.map { it.getValue() }
resolutionScope.getDescriptorsFiltered(kindFilter, nameFilter).filterTo(descriptorsSet) { resolutionScope.getDescriptorsFiltered(kindFilter, nameFilter).filterTo(descriptorsSet) {
if (it is CallableDescriptor && it.getExtensionReceiverParameter() != null) { if (it is CallableDescriptor && it.getExtensionReceiverParameter() != null)
it.isExtensionCallable(receiverValues, context, dataFlowInfo, false) it.isExtensionCallable(receiverValues, context, dataFlowInfo, false)
}
else else
true true
} }