[NI] Fix smartcasts computation for dot-qualifier expressions

This commit is contained in:
Mikhail Zarechenskiy
2018-04-16 17:43:07 +03:00
parent 55da251ffc
commit 3318549622
6 changed files with 35 additions and 3 deletions
@@ -180,7 +180,8 @@ class KotlinResolutionCallbacksImpl(
override fun createReceiverWithSmartCastInfo(resolvedAtom: ResolvedCallAtom): ReceiverValueWithSmartCastInfo? {
val returnType = resolvedAtom.candidateDescriptor.returnType ?: return null
val psiKotlinCall = resolvedAtom.atom.psiKotlinCall
val expression = psiKotlinCall.psiCall.callElement.safeAs<KtExpression>() ?: return null
val callElement = psiKotlinCall.psiCall.callElement.safeAs<KtExpression>() ?: return null
val expression = findCommonParent(callElement, resolvedAtom.atom.psiKotlinCall.explicitReceiver)
return transformToReceiverWithSmartCastInfo(
resolvedAtom.candidateDescriptor,