Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/capturedSpecificity.kt
T
2022-10-14 08:25:26 +00:00

15 lines
357 B
Kotlin
Vendored

// FIR_IDENTICAL
// SKIP_TXT
class C<T>(val value: T?)
fun <T> assignable(x: () -> T) {}
fun <V> foo(t: C<out Any>, v: C<out V>) {
assignable<V?> { v.value }
if (t == v) {
// `value: CapturedType(out V)?` <: `value: CapturedType(out Any)?` - same instantiation
assignable<V?> { v.value }
assignable<V?> { t.value }
}
}