[NI] Report errors about inapplicable wrong receiver

Now it's possible because we don't commit trace with inapplicable `provideDelegate` operator (20e105c274)
This commit is contained in:
Mikhail Zarechenskiy
2017-08-09 16:24:12 +03:00
parent 2ac7b6a534
commit 974dad571c
@@ -194,9 +194,13 @@ class PSICallResolver(
1 -> {
val singleCandidate = result.single()
val reportToTrace = singleCandidate.currentStatus.resultingApplicability != ResolutionCandidateApplicability.INAPPLICABLE_WRONG_RECEIVER
val isInapplicableReceiver = singleCandidate.currentStatus.resultingApplicability == ResolutionCandidateApplicability.INAPPLICABLE_WRONG_RECEIVER
val resolvedCall = kotlinToResolvedCallTransformer.transformAndReport<D>(singleCandidate, context, trace.takeIf { reportToTrace })
val resolvedCall = kotlinToResolvedCallTransformer.transformAndReport<D>(singleCandidate, context, trace.takeUnless { isInapplicableReceiver })
if (isInapplicableReceiver) {
tracingStrategy.unresolvedReferenceWrongReceiver(trace, listOf(resolvedCall))
}
return SingleOverloadResolutionResult(resolvedCall)
}
else -> {