diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/DiagnosticReporterByTrackingStrategy.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/DiagnosticReporterByTrackingStrategy.kt index 9583fb36bed..80a9bf2d35b 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/DiagnosticReporterByTrackingStrategy.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/DiagnosticReporterByTrackingStrategy.kt @@ -607,12 +607,12 @@ class DiagnosticReporterByTrackingStrategy( psiKotlinCall.psiCall.calleeExpression?.let { val typeVariableText = (typeVariable as? TypeVariableFromCallableDescriptor)?.originalTypeParameter?.name?.asString() ?: typeVariable.toString() + val errorFactory = if (error is InferredEmptyIntersectionError) + INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION.errorFactory + else INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION.warningFactory trace.reportDiagnosticOnce( @Suppress("UNCHECKED_CAST") - INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION.on( - context.languageVersionSettings, it, typeVariableText, - error.incompatibleTypes as Collection - ) + errorFactory.on(it, typeVariableText, error.incompatibleTypes as Collection) ) } }