[FIR] Ignore nullability in the definition of "identity-less"

The definition of a "builtin" already
ignores nullability.

`Int? === String?` must trigger a
diagnostic by design.
This commit is contained in:
Nikolay Lunyak
2023-04-19 10:27:17 +03:00
committed by Space Team
parent 5ecedcbb16
commit 8d04ab3142
19 changed files with 179 additions and 176 deletions
@@ -122,7 +122,7 @@ fun case_9(x: TypealiasNullableString<!REDUNDANT_NULLABLE!>?<!>) {
fun case_10() {
val a = Class()
if (a.prop_4 === null || <!USELESS_IS_CHECK!>true is Boolean<!>) {
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.prop_4 === null<!> || <!USELESS_IS_CHECK!>true is Boolean<!>) {
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>a.prop_4 != null !== null<!>) {
a.prop_4
a.prop_4<!UNSAFE_CALL!>.<!>equals(null)
@@ -21,7 +21,7 @@ fun case_1() {
*/
fun case_2() {
var x: Boolean? = true
if (x !== null && try { x = null; true } catch (e: Exception) { false }) {
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x !== null<!> && try { x = null; true } catch (e: Exception) { false }) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!><!UNSAFE_CALL!>.<!>not()
}