Skip to content

Instantly share code, notes, and snippets.

@mbloms
Created January 22, 2018 19:07
Show Gist options
  • Save mbloms/c7ac3e8846a649ea543c4ee2c9c00cce to your computer and use it in GitHub Desktop.
Save mbloms/c7ac3e8846a649ea543c4ee2c9c00cce to your computer and use it in GitHub Desktop.
case class Imm(stuff :Int) {
def moreStuff(x:Int) = stuff + x
}
class Mut(stuff :Int) extends Imm(stuff) {
var scary :Int = 0
override def moreStuff(x:Int) = {scary+=1; stuff+scary+x}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment