From 109ec11d5118fef0a0453c503bbb90321857fc54 Mon Sep 17 00:00:00 2001 From: Valentin Kipyatkov Date: Mon, 7 Nov 2016 19:49:21 +0300 Subject: [PATCH] Changes after rebase on master --- .../replaceWith/ReplaceWithAnnotationAnalyzer.kt | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/replaceWith/ReplaceWithAnnotationAnalyzer.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/replaceWith/ReplaceWithAnnotationAnalyzer.kt index 1898a812c37..0f3484e731d 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/replaceWith/ReplaceWithAnnotationAnalyzer.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/replaceWith/ReplaceWithAnnotationAnalyzer.kt @@ -32,6 +32,7 @@ import org.jetbrains.kotlin.psi.KtPsiFactory import org.jetbrains.kotlin.psi.KtUserType import org.jetbrains.kotlin.psi.psiUtil.forEachDescendantOfType import org.jetbrains.kotlin.resolve.* +import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfo import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe import org.jetbrains.kotlin.resolve.descriptorUtil.module import org.jetbrains.kotlin.resolve.lazy.DefaultImportProvider @@ -41,6 +42,7 @@ import org.jetbrains.kotlin.resolve.scopes.utils.chainImportingScopes import org.jetbrains.kotlin.resolve.scopes.utils.memberScopeAsImportingScope import org.jetbrains.kotlin.storage.LockBasedStorageManager import org.jetbrains.kotlin.types.expressions.ExpressionTypingServices +import org.jetbrains.kotlin.types.expressions.PreliminaryDeclarationVisitor import java.util.* data class ReplaceWith(val pattern: String, val imports: List) @@ -77,13 +79,7 @@ object ReplaceWithAnnotationAnalyzer { val scope = getResolutionScope(symbolDescriptor, symbolDescriptor, listOf(explicitImportsScope) + defaultImportsScopes) ?: return null - val expressionTypingServices = if (module.builtIns.builtInsModule == module) { - // TODO: doubtful place, do we require this module or not? Built-ins module doesn't have some necessary components... - resolutionFacade.getFrontendService(ExpressionTypingServices::class.java) - } - else { - resolutionFacade.getFrontendService(module, ExpressionTypingServices::class.java) - } + val expressionTypingServices = resolutionFacade.getFrontendService(module, ExpressionTypingServices::class.java) fun analyzeExpression(): BindingContext { return expression.analyzeInContext(scope, expressionTypingServices = expressionTypingServices)