Refine diagnostics for nullability migration warnings

#KT-24911 Fixed
This commit is contained in:
Denis Zharkov
2018-07-13 17:51:11 +03:00
parent f85030b1e6
commit 89d99e3989
34 changed files with 140 additions and 113 deletions
@@ -64,14 +64,14 @@ fun main(a: A) {
a.field<!UNSAFE_CALL!>.<!>length
a.foo2("", null)?.length
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.foo2("", null)<!>.length
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.foo2(null, "")<!>.length
<!RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.foo2("", null)<!>.length
<!RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.foo2(null, "")<!>.length
a.bar2().length
a.bar2()!!.length
a.field2?.length
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.field2<!>.length
<!RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.field2<!>.length
a.field3?.length
a.field3<!UNSAFE_CALL!>.<!>length
@@ -46,12 +46,12 @@ fun main(a: A) {
a.field.length
a.foo2("", null)?.length
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.foo2("", null)<!>.length
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.foo2(<!NULL_FOR_NONNULL_TYPE!>null<!>, "")<!>.length
<!RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.foo2("", null)<!>.length
<!RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.foo2(<!NULL_FOR_NONNULL_TYPE!>null<!>, "")<!>.length
a.bar2().length
a.bar2()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
a.field2?.length
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.field2<!>.length
<!RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.field2<!>.length
}
@@ -66,7 +66,7 @@ fun main(b: B, c: C) {
b.foo2()?.length
b.foo3()<!UNSAFE_CALL!>.<!>length
b.foo3()?.length
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>b.foo4()<!>.length
<!RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>b.foo4()<!>.length
b.foo4()?.length
b.bar(<!NULL_FOR_NONNULL_TYPE!>null<!>)
@@ -82,4 +82,4 @@ fun main(b: B, c: C) {
c.foo4()?.length
c.bar4(<!NULL_FOR_NONNULL_TYPE!>null<!>)
c.bar4("")
}
}
@@ -36,14 +36,14 @@ public class A {
fun main(a: A) {
a.foo("", null)?.length
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.foo("", null)<!>.length
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.foo(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>, "")<!>.length
<!RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.foo("", null)<!>.length
<!RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.foo(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>, "")<!>.length
a.bar().length
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
a.field?.length
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.field<!>.length
<!RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.field<!>.length
a.foo2("", null)?.length
a.foo2("", null).length