Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/constraints/approximationWithDefNotNullInInvPositionDuringInference.fir.kt
T
2020-02-19 15:32:12 +03:00

25 lines
372 B
Kotlin
Vendored

// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER
// Issues: KT-36816
interface Parent<T>
class Foo<K>(x: K?): Parent<K> {}
class Bar<T>(x: T): Parent<T> {}
fun <R> select(vararg x: R) = x[0]
fun <S> main(x: S) {
select(Foo(x), Bar(x))
}
inline fun <R> test(transform: () -> R) {}
class Inv<T>(x: T?) {}
fun <K> foo(x: K) {
test { Inv(x) }
}