K2: don't count use-sites of Java type parameter with nullable bounds as not null

This commit is contained in:
Mikhail Glukhikh
2024-03-08 13:41:25 +01:00
committed by Space Team
parent d353fd400d
commit c4bcdc42c1
14 changed files with 413 additions and 70 deletions
@@ -17,19 +17,15 @@ public class Test {}
fun <T : Test> main(a1: NonPlatformTypeParameter<Any?>, a2: NonPlatformTypeParameter<Test>, x: T): Unit {
a1.foo(null)
a1.bar<Test?>(null)
// jspecify_nullness_mismatch
a1.bar<T>(<!NULL_FOR_NONNULL_TYPE!>null<!>)
a1.bar<T>(null)
a1.bar<T>(x)
// jspecify_nullness_mismatch
a2.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>)
a2.foo(null)
a2.bar<Test?>(null)
// jspecify_nullness_mismatch
a2.bar<T>(<!NULL_FOR_NONNULL_TYPE!>null<!>)
a2.bar<T>(null)
a2.bar<T>(x)
}
fun testNullable(a1: NonPlatformTypeParameter<Test>, x: Test?) {
// jspecify_nullness_mismatch
a1.foo(<!ARGUMENT_TYPE_MISMATCH!>x<!>)
a1.foo(x)
}