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
@@ -0,0 +1,46 @@
class Inv<T : Any?> {
val x: T
field = x
get
constructor(x: T) /* primary */ {
super/*Any*/()
/* <init>() */
}
}
class Test_1<TT : Any?> : JavaClass1<TT> {
val x: TT
field = x
get
constructor(x: TT) /* primary */ {
super/*JavaClass1*/<TT>()
/* <init>() */
}
fun test(b: B<TT>) {
b.output(x = <this>.<get-x>())
}
}
class Test_2<TT : Any?> : JavaClass2<TT, Inv<TT>> {
constructor() /* primary */ {
super/*JavaClass2*/<TT, Inv<TT>>()
/* <init>() */
}
fun process(b: B<TT, Inv<TT>>) {
b.output(output = Inv<TT>(x = b.element()))
}
}
fun <R : Any?> test_3(jb: B<R>, r: R) {
jb.output(x = r)
}