Created
January 11, 2011 20:14
-
-
Save dwins/775038 to your computer and use it in GitHub Desktop.
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 MyString { | |
def theString: String | |
} | |
case class AString(theString: String) extends MyString | |
case class IntAsString(theInt: Int) extends MyString { | |
def theString = theInt.toString | |
} | |
object MyString { | |
def unapply(ms: MyString) = Some(ms.theString) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment