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:
Tianyu Geng
2021-07-28 13:29:37 -07:00
committed by teamcityserver
parent c7272f6986
commit 263b876e6e
16 changed files with 97 additions and 98 deletions
@@ -225,8 +225,8 @@ fun case_23(value_1: Nothing) {
// TESTCASE NUMBER: 24
fun case_24(value_1: Nothing?) = when (value_1) {
throw Exception(), <!RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY!>return<!> "" -> ""
<!SENSELESS_NULL_IN_WHEN!>null<!>, <!RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY!>return<!> <!RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY!>return<!> <!RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY!>return<!> "", throw throw throw Exception() -> ""
<!SENSELESS_COMPARISON!>throw Exception()<!>, <!SENSELESS_COMPARISON!><!RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY!>return<!> ""<!> -> ""
<!SENSELESS_NULL_IN_WHEN!>null<!>, <!SENSELESS_COMPARISON!><!RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY!>return<!> <!RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY!>return<!> <!RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY!>return<!> ""<!>, <!SENSELESS_COMPARISON!>throw throw throw Exception()<!> -> ""
else -> ""
}