Skip to content

Instantly share code, notes, and snippets.

@florianleibert
Created December 7, 2012 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save florianleibert/4235863 to your computer and use it in GitHub Desktop.
Save florianleibert/4235863 to your computer and use it in GitHub Desktop.
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