Created
December 7, 2012 19:36
-
-
Save florianleibert/4235863 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
scala> case class Foo(val name : String) | |
defined class Foo | |
scala> case class Bar(override val name : String, val age : Int) extends Foo(name : String) | |
warning: there were 1 deprecation warnings; re-run with -deprecation for details | |
defined class Bar | |
scala> val a = Bar("foo", 1) | |
a: Bar = Foo(foo) | |
scala> val b = a.copy(name = "Stuff") | |
b: Foo = Foo(Stuff) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment