FIR checker: record whether type mismatch is due to nullability
This is useful for downstream quickfixes.
This commit is contained in:
committed by
teamcityserver
parent
d3e8cc577c
commit
951812f130
+7
@@ -401,14 +401,17 @@ object DIAGNOSTICS_LIST : DiagnosticList("FirErrors") {
|
||||
val TYPE_MISMATCH by error<PsiElement> {
|
||||
parameter<ConeKotlinType>("expectedType")
|
||||
parameter<ConeKotlinType>("actualType")
|
||||
parameter<Boolean>("isMismatchDueToNullability")
|
||||
}
|
||||
|
||||
val THROWABLE_TYPE_MISMATCH by error<PsiElement> {
|
||||
parameter<ConeKotlinType>("actualType")
|
||||
parameter<Boolean>("isMismatchDueToNullability")
|
||||
}
|
||||
|
||||
val CONDITION_TYPE_MISMATCH by error<PsiElement> {
|
||||
parameter<ConeKotlinType>("actualType")
|
||||
parameter<Boolean>("isMismatchDueToNullability")
|
||||
}
|
||||
|
||||
val ARGUMENT_TYPE_MISMATCH by error<PsiElement> {
|
||||
@@ -446,6 +449,7 @@ object DIAGNOSTICS_LIST : DiagnosticList("FirErrors") {
|
||||
val ASSIGNMENT_TYPE_MISMATCH by error<KtExpression> {
|
||||
parameter<ConeKotlinType>("expectedType")
|
||||
parameter<ConeKotlinType>("actualType")
|
||||
parameter<Boolean>("isMismatchDueToNullability")
|
||||
}
|
||||
|
||||
val RESULT_TYPE_MISMATCH by error<KtExpression> {
|
||||
@@ -579,6 +583,7 @@ object DIAGNOSTICS_LIST : DiagnosticList("FirErrors") {
|
||||
parameter<ConeKotlinType>("expectedType")
|
||||
parameter<ConeKotlinType>("actualType")
|
||||
parameter<FirSimpleFunction>("targetFunction")
|
||||
parameter<Boolean>("isMismatchDueToNullability")
|
||||
}
|
||||
|
||||
val CYCLIC_GENERIC_UPPER_BOUND by error<PsiElement>()
|
||||
@@ -617,6 +622,7 @@ object DIAGNOSTICS_LIST : DiagnosticList("FirErrors") {
|
||||
parameter<ConeKotlinType>("desiredType")
|
||||
parameter<FirExpression>("subject")
|
||||
parameter<String>("description")
|
||||
parameter<Boolean>("isCastToNotNull")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -874,6 +880,7 @@ object DIAGNOSTICS_LIST : DiagnosticList("FirErrors") {
|
||||
val INITIALIZER_TYPE_MISMATCH by error<KtProperty>(PositioningStrategy.PROPERTY_INITIALIZER) {
|
||||
parameter<ConeKotlinType>("expectedType")
|
||||
parameter<ConeKotlinType>("actualType")
|
||||
parameter<Boolean>("isMismatchDueToNullability")
|
||||
}
|
||||
val GETTER_VISIBILITY_DIFFERS_FROM_PROPERTY_VISIBILITY by error<KtModifierListOwner>(PositioningStrategy.VISIBILITY_MODIFIER)
|
||||
val SETTER_VISIBILITY_INCONSISTENT_WITH_PROPERTY_VISIBILITY by error<KtModifierListOwner>(PositioningStrategy.VISIBILITY_MODIFIER)
|
||||
|
||||
Reference in New Issue
Block a user