Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type | [+A, +B] = Union.Type[A, B]
- object Union {
- trait Tag extends Any
- type Base
- type Type[+A, +B] <: Base with Tag
- implicit def first[A]: A <:< Type[A, Nothing] =
- implicitly[A <:< A].asInstanceOf[A <:< Type[A, Nothing]]
- implicit def second[B]: B <:< Type[Nothing, B] =
- implicitly[B <:< B].asInstanceOf[B <:< Type[Nothing, B]]
- }
- object A
- object B
- object C
- type X = A.type | B.type | C.type
- type Y = A.type with B.type with C.type
- implicitly[Y <:< X]
Add Comment
Please, Sign In to add comment