Skip to content

Instantly share code, notes, and snippets.

@esammer
Last active December 11, 2015 23:58
Show Gist options
  • Save esammer/4680106 to your computer and use it in GitHub Desktop.
Save esammer/4680106 to your computer and use it in GitHub Desktop.
damn scala you busted
scala> :silent
Switched off result printing.
scala> class Bad {
| var toStringCount: Int = 0
| override def toString(): String = { toStringCount += 1 ; super.toString() }
| }
scala> val b = new Bad
scala> println(b.toStringCount)
1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment