Skip to content

Instantly share code, notes, and snippets.

@aereal
Created May 31, 2016
Embed
What would you like to do?
trait Bounded[T <: Bounded[T]] {
self: T =>
}
trait BoundedFactory[V, B <: Bounded[B]] {
def build(b: B): V
}
case class Box[V](value: V) extends Bounded[Box[V]]
class BoxFactory[T] extends BoundedFactory[T, Box[T]] {
def build(b: Box[T]) = b.value
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment