[NI] Approximate receivers for callable reference candidates

#KT-36221 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2020-01-31 15:13:14 +03:00
parent 517688e163
commit 60a2d0f037
6 changed files with 66 additions and 2 deletions
@@ -369,8 +369,10 @@ class ResolvedAtomCompleter(
}
private fun ReceiverValue.updateReceiverValue(substitutor: TypeSubstitutor): ReceiverValue {
val newType = substitutor.safeSubstitute(type, Variance.INVARIANT)
return if (type != newType) replaceType(newType) else this
val newType = substitutor.safeSubstitute(type, Variance.INVARIANT).let {
typeApproximator.approximateToSuperType(it, TypeApproximatorConfiguration.FinalApproximationAfterResolutionAndInference) ?: it
}
return if (type != newType) replaceType(newType as KotlinType) else this
}
private fun recordArgumentAdaptationForCallableReference(