[Test] Add regression test for KT-66336

This commit is contained in:
Dmitriy Novozhilov
2024-03-14 11:34:02 +02:00
committed by Space Team
parent fcc4470b74
commit c62fe0d107
6 changed files with 50 additions and 0 deletions
@@ -0,0 +1,20 @@
// FIR_IDENTICAL
// ISSUE: KT-66336
interface A : Comparable<A>
interface B : Comparable<B>
open class Base<T>
class Derived<T : Comparable<T>, in S : T?>(expr: Base<in S>) : Base<T?>()
fun call(f: (String) -> Base<*>? = { null }) {}
fun test(b: Base<B>) {
call {
when (it) {
"a" -> b
"b" -> Derived(Base<A>())
else -> null
}
}
}