Created
December 4, 2010 16:55
-
-
Save skanev/728317 to your computer and use it in GitHub Desktop.
The epic fight between inheritance and type systems, in pseudo-Scala
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
class StrangeIntQue extends Queue[Int] { | |
override def append(x: Int) { | |
println(Math.sqrt(x)) | |
super.append(x) | |
} | |
} | |
val x: Queue[Any] = new StrangeIntQueue | |
x.append("abc") // Math.sqrt("abc") ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment