[FE 1.0] Report errors or warnings for INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION depending on previously recorded kind of diagnostic
This commit is contained in:
committed by
teamcity
parent
1535ab8eed
commit
73d676d9de
+4
-4
@@ -607,12 +607,12 @@ class DiagnosticReporterByTrackingStrategy(
|
|||||||
psiKotlinCall.psiCall.calleeExpression?.let {
|
psiKotlinCall.psiCall.calleeExpression?.let {
|
||||||
val typeVariableText = (typeVariable as? TypeVariableFromCallableDescriptor)?.originalTypeParameter?.name?.asString()
|
val typeVariableText = (typeVariable as? TypeVariableFromCallableDescriptor)?.originalTypeParameter?.name?.asString()
|
||||||
?: typeVariable.toString()
|
?: 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(
|
trace.reportDiagnosticOnce(
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION.on(
|
errorFactory.on(it, typeVariableText, error.incompatibleTypes as Collection<KotlinType>)
|
||||||
context.languageVersionSettings, it, typeVariableText,
|
|
||||||
error.incompatibleTypes as Collection<KotlinType>
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user