From 2b66af29aa098a42bf125dd119f5f94787ad7171 Mon Sep 17 00:00:00 2001 From: Stanislav Erokhin Date: Fri, 27 Nov 2015 16:08:30 +0300 Subject: [PATCH] Added debug info --- .../kotlin/resolve/calls/tower/NewResolveOldInference.kt | 7 +++++-- .../org/jetbrains/kotlin/resolve/calls/tower/ScopeTower.kt | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/NewResolveOldInference.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/NewResolveOldInference.kt index 4a7c16ac1cb..043c0cb82a7 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/NewResolveOldInference.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/NewResolveOldInference.kt @@ -224,10 +224,13 @@ class NewResolveOldInference( } override fun contextForInvoke(variable: Candidate, useExplicitReceiver: Boolean): Pair> { - assert(variable.resolvedCall.status.isSuccess) + assert(variable.resolvedCall.status.possibleTransformToSuccess()) { + "Incorrect status: ${variable.resolvedCall.status} for variable call: ${variable.resolvedCall} " + + "and descriptor: ${variable.resolvedCall.candidateDescriptor}" + } val calleeExpression = variable.resolvedCall.call.calleeExpression val variableDescriptor = variable.resolvedCall.resultingDescriptor - assert(variable.resolvedCall.status.isSuccess && calleeExpression != null && variableDescriptor is VariableDescriptor) { + assert(variable.resolvedCall.status.possibleTransformToSuccess() && calleeExpression != null && variableDescriptor is VariableDescriptor) { "Unexpected varialbe candidate: $variable" } val variableReceiver = ExpressionReceiver.create(calleeExpression!!, diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ScopeTower.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ScopeTower.kt index 3ea83752fea..92228300b8f 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ScopeTower.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ScopeTower.kt @@ -67,7 +67,7 @@ interface CandidateWithBoundDispatchReceiver { val dispatchReceiver: ReceiverValue? } -class ResolutionCandidateStatus(val diagnostics: List) { +data class ResolutionCandidateStatus(val diagnostics: List) { val resultingApplicability: ResolutionCandidateApplicability = diagnostics.asSequence().map { it.candidateLevel }.max() ?: ResolutionCandidateApplicability.RESOLVED }