[NI] Use resolved lhsType as unbound receiver.

This commit is contained in:
Stanislav Erokhin
2017-06-16 16:49:47 +03:00
committed by Mikhail Zarechenskiy
parent c752e1580e
commit f1144c9f01
2 changed files with 3 additions and 3 deletions
@@ -564,7 +564,7 @@ class PSICallResolver(
is DoubleColonLHS.Type -> { is DoubleColonLHS.Type -> {
val qualifier = expressionTypingContext.trace.get(BindingContext.QUALIFIER, ktExpression.receiverExpression!!.referenceExpression()) val qualifier = expressionTypingContext.trace.get(BindingContext.QUALIFIER, ktExpression.receiverExpression!!.referenceExpression())
if (qualifier is ClassQualifier) { if (qualifier is ClassQualifier) {
LHSResult.Type(qualifier) LHSResult.Type(qualifier, lhsResult.type.unwrap())
} }
else { else {
LHSResult.Empty // this is error case actually LHSResult.Empty // this is error case actually
@@ -81,7 +81,7 @@ interface FunctionExpression : LambdaKotlinCallArgument {
* D.E::foo <-> Expression * D.E::foo <-> Expression
*/ */
sealed class LHSResult { sealed class LHSResult {
class Type(val qualifier: QualifierReceiver): LHSResult() { class Type(val qualifier: QualifierReceiver, resolvedType: UnwrappedType): LHSResult() {
val unboundDetailedReceiver: ReceiverValueWithSmartCastInfo val unboundDetailedReceiver: ReceiverValueWithSmartCastInfo
init { init {
@@ -89,7 +89,7 @@ sealed class LHSResult {
"Should be ClassDescriptor: ${qualifier.descriptor}" "Should be ClassDescriptor: ${qualifier.descriptor}"
} }
val unboundReceiver = TransientReceiver((qualifier.descriptor as ClassDescriptor).defaultType) val unboundReceiver = TransientReceiver(resolvedType)
unboundDetailedReceiver = ReceiverValueWithSmartCastInfo(unboundReceiver, emptySet(), isStable = true) unboundDetailedReceiver = ReceiverValueWithSmartCastInfo(unboundReceiver, emptySet(), isStable = true)
} }
} }