[FE] Add clear warning about future changes about nullability of safe call with non nullable receiver
^KT-46860
This commit is contained in:
committed by
teamcityserver
parent
937f4c1dab
commit
f26059a7d3
+1
-1
@@ -64,7 +64,7 @@ fun safeCalls() {
|
||||
val a = jsr.string?.length
|
||||
val b = jsrNullable?.string?.length
|
||||
|
||||
val c = jb.string<!UNNECESSARY_SAFE_CALL!>?.<!>length
|
||||
val c = <!SAFE_CALL_WILL_CHANGE_NULLABILITY!>jb.string<!UNNECESSARY_SAFE_CALL!>?.<!>length<!>
|
||||
val d = jbNullable?.string?.length
|
||||
|
||||
val e = platform.string?.length
|
||||
|
||||
Vendored
+1
-1
@@ -64,7 +64,7 @@ fun safeCalls() {
|
||||
val a = jsr.string<!UNNECESSARY_SAFE_CALL!>?.<!>length
|
||||
val b = jsrNullable?.string?.length
|
||||
|
||||
val c = jb.string<!UNNECESSARY_SAFE_CALL!>?.<!>length
|
||||
val c = <!SAFE_CALL_WILL_CHANGE_NULLABILITY!>jb.string<!UNNECESSARY_SAFE_CALL!>?.<!>length<!>
|
||||
val d = jbNullable?.string?.length
|
||||
|
||||
val e = platform.string?.length
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ fun main(a: A) {
|
||||
a.field.length
|
||||
a.field = null
|
||||
|
||||
a.nonNullField<!UNNECESSARY_SAFE_CALL!>?.<!>length
|
||||
<!SAFE_CALL_WILL_CHANGE_NULLABILITY!>a.nonNullField<!UNNECESSARY_SAFE_CALL!>?.<!>length<!>
|
||||
a.nonNullField.length
|
||||
a.nonNullField = <!NULL_FOR_NONNULL_TYPE!>null<!>
|
||||
}
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ fun main(a: A) {
|
||||
<!RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.field<!>.length
|
||||
a.field = null
|
||||
|
||||
a.nonNullField<!UNNECESSARY_SAFE_CALL!>?.<!>length
|
||||
<!SAFE_CALL_WILL_CHANGE_NULLABILITY!>a.nonNullField<!UNNECESSARY_SAFE_CALL!>?.<!>length<!>
|
||||
a.nonNullField.length
|
||||
a.nonNullField = <!NULL_FOR_NONNULL_TYPE!>null<!>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user