Skip to content

Instantly share code, notes, and snippets.

@wheaties
Created February 18, 2016 02:24
Show Gist options
  • Select an option

  • Save wheaties/35b0d20133e10d04c4e7 to your computer and use it in GitHub Desktop.

Select an option

Save wheaties/35b0d20133e10d04c4e7 to your computer and use it in GitHub Desktop.
Inheritance
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