Created
November 7, 2010 20:16
-
-
Save remeniuk/666384 to your computer and use it in GitHub Desktop.
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
sealed trait Base[T] { | |
val s: Option[String] | |
def copy(s: Option[String]) : T | |
} | |
case class CaseClass(override val s: Option[String] = None) extends Base[CaseClass] { | |
override def copy(s: Option[String]) = CaseClass(s) | |
} | |
def method[T <: Base[T]](base : Base[T]): T = { | |
base copy (s = Some("strng")) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment