Files
kotlin-fork/compiler/testData/diagnostics/tests/regressions/OutProjections.fir.kt
T
Denis.Zharkov 00821bbc63 FIR: Update test data (repeated diagnostics)
They are a bit redundant, but it needs additional work to be done
to avoid them
2021-05-20 17:24:33 +03:00

23 lines
365 B
Kotlin
Vendored

// !WITH_NEW_INFERENCE
class Point() {
}
class G<T>() {}
fun <T> f(expression : T) : G<out T> = G<T>()
fun foo() : G<Point> {
val p = Point()
return <!RETURN_TYPE_MISMATCH, TYPE_MISMATCH!>f<Point>(p)<!>
}
class Out<out T>() {}
fun <T> fout(expression : T) : Out<out T> = Out<T>()
fun fooout() : Out<Point> {
val p = Point();
return fout<Point>(p);
}