Files
kotlin-fork/compiler/testData/diagnostics/tests/regressions/OutProjections.kt
T
2012-11-24 15:59:16 +04:00

21 lines
390 B
Kotlin

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