Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/completion/equalityConstraintUpstairs.fir.kt
T
Pavel Kirpichenkov 384bd858e9 [NI] Support fixation to subtype in completion mode calculator
Allow full compltion mode for return type depending on type parameters in
contravariant position only if they have proper equality constraint.
2019-12-25 14:59:05 +03:00

17 lines
327 B
Kotlin
Vendored

// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER
class In<in I>(arg: I)
class Out<out O>(val prop: O)
class Inv<T>(val prop: T)
interface Upper
class Lower : Upper
fun <K> id(arg: K): K = arg
fun test(lower: Lower) {
id<Inv<Upper>>(Inv(lower))
id<In<Upper>>(In(lower))
id<Out<Upper>>(Out(lower))
}