From 81e4114c5a6fb061f09c5fdd10e3fd53986c4f21 Mon Sep 17 00:00:00 2001 From: Valentin Kipyatkov Date: Fri, 29 Apr 2016 18:34:39 +0300 Subject: [PATCH] Minor --- .../jetbrains/kotlin/idea/completion/smart/StaticMembers.kt | 2 +- .../src/org/jetbrains/kotlin/idea/completion/smart/Utils.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/smart/StaticMembers.kt b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/smart/StaticMembers.kt index 2a37f8faa9a..72640391e18 100644 --- a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/smart/StaticMembers.kt +++ b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/smart/StaticMembers.kt @@ -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 */ diff --git a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/smart/Utils.kt b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/smart/Utils.kt index 4716ec73701..9561b2d4ef4 100644 --- a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/smart/Utils.kt +++ b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/smart/Utils.kt @@ -156,7 +156,7 @@ fun Collection.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 MutableCollection.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()