Last active
October 17, 2017 08:06
-
-
Save sir-wabbit/dedd7187be6490fb0976256ab67baaa2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment