Created
January 22, 2018 19:07
-
-
Save mbloms/c7ac3e8846a649ea543c4ee2c9c00cce 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
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