Created
February 18, 2016 02:24
-
-
Save wheaties/35b0d20133e10d04c4e7 to your computer and use it in GitHub Desktop.
Inheritance
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
| trait OneOf[Obj, Items] | |
| object OneOf extends LowPriorityOneOf{ | |
| implicit def left[L, R, Obj <: L] = new OneOf[Obj, L | R] | |
| } | |
| protected trait LowPriorityOneOf{ | |
| implicit def right[L, R, Obj <: R] = new OneOf[Obj, L | R] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment