Added debug info

This commit is contained in:
Stanislav Erokhin
2015-11-27 16:08:30 +03:00
parent 22b14cfc5c
commit 2b66af29aa
2 changed files with 6 additions and 3 deletions
@@ -224,10 +224,13 @@ class NewResolveOldInference(
}
override fun contextForInvoke(variable: Candidate, useExplicitReceiver: Boolean): Pair<ReceiverValue, TowerContext<Candidate>> {
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!!,
@@ -67,7 +67,7 @@ interface CandidateWithBoundDispatchReceiver<out D : CallableDescriptor> {
val dispatchReceiver: ReceiverValue?
}
class ResolutionCandidateStatus(val diagnostics: List<ResolutionDiagnostic>) {
data class ResolutionCandidateStatus(val diagnostics: List<ResolutionDiagnostic>) {
val resultingApplicability: ResolutionCandidateApplicability = diagnostics.asSequence().map { it.candidateLevel }.max()
?: ResolutionCandidateApplicability.RESOLVED
}