deprecating types after colon

This commit is contained in:
Dmitry Jemerov
2015-04-21 18:32:31 +02:00
parent b7a4b3c17d
commit f374eec8f1
268 changed files with 1055 additions and 769 deletions
@@ -1,3 +1,5 @@
// !CHECK_TYPE
trait Either<out A, out B>
trait Left<out A>: Either<A, Nothing>
trait Right<out B>: Either<Nothing, B>
@@ -7,10 +9,10 @@ class C2(val v2: Int)
fun _as_left(e: Either<C1, C2>): Any? {
val v = e as? Left
return v: Left<C1>?
return checkSubtype<Left<C1>?>(v)
}
fun _as_right(e: Either<C1, C2>): Any? {
val v = e as? Right
return v: Right<C2>?
return checkSubtype<Right<C2>?>(v)
}