K1/K2: add a test for KT-50008

This commit is contained in:
Mikhail Glukhikh
2024-03-08 12:14:50 +01:00
committed by Space Team
parent 2f056fe155
commit d353fd400d
6 changed files with 53 additions and 3 deletions
@@ -25,3 +25,7 @@ fun <T : Test> main(a1: NonPlatformTypeParameter<Any?>, a2: NonPlatformTypeParam
a2.bar<T>(null)
a2.bar<T>(x)
}
fun testNullable(a1: NonPlatformTypeParameter<Test>, x: Test?) {
a1.foo(x)
}
@@ -27,4 +27,9 @@ fun <T : Test> main(a1: NonPlatformTypeParameter<Any?>, a2: NonPlatformTypeParam
// jspecify_nullness_mismatch
a2.bar<T>(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>)
a2.bar<T>(x)
}
}
fun testNullable(a1: NonPlatformTypeParameter<Test>, x: Test?) {
// jspecify_nullness_mismatch
a1.foo(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>x<!>)
}
@@ -1,6 +1,7 @@
package
public fun </*0*/ T : Test> main(/*0*/ a1: NonPlatformTypeParameter<kotlin.Any?>, /*1*/ a2: NonPlatformTypeParameter<Test>, /*2*/ x: T): kotlin.Unit
public fun testNullable(/*0*/ a1: NonPlatformTypeParameter<Test>, /*1*/ x: Test?): kotlin.Unit
public open class NonPlatformTypeParameter</*0*/ T : @org.jspecify.annotations.Nullable kotlin.Any!> {
public constructor NonPlatformTypeParameter</*0*/ T : @org.jspecify.annotations.Nullable kotlin.Any!>()