FIR: extends scope of SENSELESS_COMPARISON
FE1.0 only reports SENSELESS_COMPARISON if one of the operand is `null`. This change makes FIR reports also in case one of the operand has type `Nothing?`. In addition, fix handling of type alias in ConeTypeContext#isNullableType
This commit is contained in:
committed by
teamcityserver
parent
c7272f6986
commit
263b876e6e
+1
-1
@@ -1825,7 +1825,7 @@ sealed class KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
abstract val unreachable: List<PsiElement>
|
||||
}
|
||||
|
||||
abstract class SenselessComparison : KtFirDiagnostic<KtBinaryExpression>() {
|
||||
abstract class SenselessComparison : KtFirDiagnostic<KtExpression>() {
|
||||
override val diagnosticClass get() = SenselessComparison::class
|
||||
abstract val expression: KtExpression
|
||||
abstract val compareResult: Boolean
|
||||
|
||||
+1
-1
@@ -2944,7 +2944,7 @@ internal class SenselessComparisonImpl(
|
||||
override val compareResult: Boolean,
|
||||
firDiagnostic: FirPsiDiagnostic,
|
||||
override val token: ValidityToken,
|
||||
) : KtFirDiagnostic.SenselessComparison(), KtAbstractFirDiagnostic<KtBinaryExpression> {
|
||||
) : KtFirDiagnostic.SenselessComparison(), KtAbstractFirDiagnostic<KtExpression> {
|
||||
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user