This commit is contained in:
Valentin Kipyatkov
2016-04-29 18:34:39 +03:00
parent 941b415981
commit 81e4114c5a
2 changed files with 3 additions and 3 deletions
@@ -84,7 +84,7 @@ class StaticMembers(
val matcher: (ExpectedInfo) -> ExpectedInfoMatch
if (descriptor is CallableDescriptor) {
val returnType = descriptor.fuzzyReturnType() ?: return
matcher = { expectedInfo -> returnType.classifyExpectedInfo(expectedInfo) }
matcher = { expectedInfo -> returnType.matchExpectedInfo(expectedInfo) }
}
else if (DescriptorUtils.isEnumEntry(descriptor) && !enumEntriesToSkip.contains(descriptor)) {
matcher = { ExpectedInfoMatch.match(TypeSubstitutor.EMPTY) } /* we do not need to check type of enum entry because it's taken from proper enum */
@@ -156,7 +156,7 @@ fun Collection<FuzzyType>.matchExpectedInfo(expectedInfo: ExpectedInfo): Expecte
return ExpectedInfoMatch.noMatch
}
fun FuzzyType.classifyExpectedInfo(expectedInfo: ExpectedInfo) = listOf(this).matchExpectedInfo(expectedInfo)
fun FuzzyType.matchExpectedInfo(expectedInfo: ExpectedInfo) = listOf(this).matchExpectedInfo(expectedInfo)
fun<TDescriptor: DeclarationDescriptor?> MutableCollection<LookupElement>.addLookupElements(
descriptor: TDescriptor,
@@ -290,7 +290,7 @@ fun DeclarationDescriptor.fuzzyTypesForSmartCompletion(
}
if (this is CallableDescriptor) {
var returnType = fuzzyReturnType() ?: return emptyList()
val returnType = fuzzyReturnType() ?: return emptyList()
// skip declarations of type Nothing or of generic parameter type which has no real bounds
if (returnType.type.isNothing() || returnType.isAlmostEverything()) return emptyList()