From 5a69a17ab02272e9a60c0c638bb2007c0d38e600 Mon Sep 17 00:00:00 2001 From: Valentin Kipyatkov Date: Thu, 29 Oct 2015 18:15:14 +0300 Subject: [PATCH] Minor --- .../org/jetbrains/kotlin/idea/completion/CompletionSession.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/CompletionSession.kt b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/CompletionSession.kt index b058e3cef49..928dcf16bd5 100644 --- a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/CompletionSession.kt +++ b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/CompletionSession.kt @@ -316,10 +316,12 @@ abstract class CompletionSession(protected val configuration: CompletionSessionC } protected fun getRuntimeReceiverTypeReferenceVariants(): Pair? { + val evaluator = file.getCopyableUserData(KtCodeFragment.RUNTIME_TYPE_EVALUATOR) ?: return null + val explicitReceiver = callTypeAndReceiver.receiver as? KtExpression ?: return null val type = bindingContext.getType(explicitReceiver) ?: return null if (!TypeUtils.canHaveSubtypes(KotlinTypeChecker.DEFAULT, type)) return null - val evaluator = file.getCopyableUserData(KtCodeFragment.RUNTIME_TYPE_EVALUATOR) ?: return null + val runtimeType = evaluator(explicitReceiver) if (runtimeType == null || runtimeType == type) return null