Last active
December 11, 2015 23:58
-
-
Save esammer/4680106 to your computer and use it in GitHub Desktop.
damn scala you busted
This file contains 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> :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