K2: add a black box test to confirm KT-55705 now works properly

This commit is contained in:
Mikhail Glukhikh
2023-11-13 22:33:05 +01:00
committed by Space Team
parent f2ef41dbbd
commit 4b1368409d
20 changed files with 138 additions and 0 deletions
@@ -0,0 +1,25 @@
// ISSUE: KT-55705
interface A<T> {
fun foo(x: T?) {}
}
interface B : A<String> {
override fun foo(x: String?)
}
fun <T> bar(x: A<in T>) {
if (x is B) {
// The code should be green
x.foo(null)
}
}
fun box(): String {
bar<String>(
object : B {
override fun foo(x: String?) {}
}
)
return "OK"
}