[FIR] Implement warnings for java nullability type mismatch
#KT-56989
This commit is contained in:
committed by
Space Team
parent
1ecbc094ec
commit
a6fdeeb7df
+1
-1
@@ -18,7 +18,7 @@ public class ClassWithExternalAnnotatedMembers {
|
||||
// FILE: usage.kt
|
||||
fun test() {
|
||||
val i: Int? = null
|
||||
ClassWithExternalAnnotatedMembers(i)
|
||||
ClassWithExternalAnnotatedMembers(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>i<!>)
|
||||
|
||||
val s: String? = null
|
||||
<!NONE_APPLICABLE!>ClassWithExternalAnnotatedMembers<!>(s)
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@ public class ClassWithExternalAnnotatedMembers {
|
||||
// FILE: usage.kt
|
||||
fun test() {
|
||||
val i: Int? = null
|
||||
ClassWithExternalAnnotatedMembers(i)
|
||||
ClassWithExternalAnnotatedMembers(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>i<!>)
|
||||
|
||||
val s: String? = null
|
||||
<!NONE_APPLICABLE!>ClassWithExternalAnnotatedMembers<!>(s)
|
||||
@@ -22,7 +22,7 @@ fun test() {
|
||||
val b: Boolean? = null
|
||||
<!NONE_APPLICABLE!>ClassWithExternalAnnotatedMembers<!>(b)
|
||||
|
||||
ClassWithExternalAnnotatedMembers(null)
|
||||
ClassWithExternalAnnotatedMembers(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>)
|
||||
}
|
||||
|
||||
// FILE: annotations.xml
|
||||
|
||||
+2
-2
@@ -16,12 +16,12 @@ fun test() {
|
||||
instance.<!NONE_APPLICABLE!>method<!>(i)
|
||||
|
||||
val s: String? = null
|
||||
instance.method(s)
|
||||
instance.method(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>s<!>)
|
||||
|
||||
val b: Boolean? = null
|
||||
instance.<!NONE_APPLICABLE!>method<!>(b)
|
||||
|
||||
instance.method(null)
|
||||
instance.method(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>)
|
||||
}
|
||||
|
||||
// FILE: annotations.xml
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ fun test() {
|
||||
instance.<!NONE_APPLICABLE!>method<!>(i)
|
||||
|
||||
val s: String? = null
|
||||
instance.method(s)
|
||||
instance.method(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>s<!>)
|
||||
|
||||
val b: Boolean? = null
|
||||
instance.method(b)
|
||||
|
||||
Reference in New Issue
Block a user