[FIR] Add REDUNDANT_NULLABLE diagnostics

This commit is contained in:
Ivan Kochurkin
2021-11-19 16:21:51 +03:00
committed by TeamCityServer
parent 4caf3c5e83
commit 51b73bb6ae
37 changed files with 233 additions and 87 deletions
@@ -1,6 +1,7 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_EXPRESSION
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_VARIABLE
// SKIP_TXT
// WITH_EXTENDED_CHECKERS
// TESTCASE NUMBER: 1
fun case_1(x: Any?) {
@@ -108,7 +109,7 @@ fun case_8(x: TypealiasNullableString) {
}
// TESTCASE NUMBER: 9
fun case_9(x: TypealiasNullableString?) {
fun case_9(x: TypealiasNullableString<!REDUNDANT_NULLABLE!>?<!>) {
if (<!SENSELESS_COMPARISON!>x === null === null<!>) {
} else if (<!USELESS_IS_CHECK!>false is Boolean<!>) {
@@ -138,7 +139,7 @@ fun case_10() {
}
// TESTCASE NUMBER: 11
fun case_11(x: TypealiasNullableStringIndirect?, y: TypealiasNullableStringIndirect) {
fun case_11(x: TypealiasNullableStringIndirect<!REDUNDANT_NULLABLE!>?<!>, y: TypealiasNullableStringIndirect) {
val t: TypealiasNullableStringIndirect = null
if (<!EQUALITY_NOT_APPLICABLE!>x == null is Boolean<!>) {