This file contains 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
object TypeSafeBuilder { | |
type F | |
type T | |
case class Cat(name: String, age: Int) | |
object CatBuilder { | |
def apply() = new CatBuilder[F, F](None, None) | |
implicit class BuildableCatBuilder(cb: CatBuilder[T, T]) { | |
def build(): Cat = cb.hiddenBuild() |