deprecating types after colon
This commit is contained in:
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user