[NI] Resolution diagnostics don't produce errors as is

This commit is contained in:
Mikhail Zarechenskiy
2017-07-13 16:03:04 +03:00
parent 5486f4e612
commit b6e195128c
@@ -348,7 +348,10 @@ class KotlinToResolvedCallTransformer(
for (diagnostic in completedCall.resolutionStatus.diagnostics) {
trackingTrace.reported = false
diagnostic.report(diagnosticReporter)
if (!trackingTrace.reported && REPORT_MISSING_NEW_INFERENCE_DIAGNOSTIC) {
val dontRecordToTraceAsIs = diagnostic is ResolutionDiagnostic && diagnostic !is VisibilityError
val shouldReportMissingDiagnostic = !trackingTrace.reported && !dontRecordToTraceAsIs
if (shouldReportMissingDiagnostic && REPORT_MISSING_NEW_INFERENCE_DIAGNOSTIC) {
val factory = if (diagnostic.candidateApplicability.isSuccess) Errors.NEW_INFERENCE_DIAGNOSTIC else Errors.NEW_INFERENCE_ERROR
trace.report(factory.on(diagnosticReporter.psiKotlinCall.psiCall.callElement, "Missing diagnostic: $diagnostic"))
}