Skip to content

Instantly share code, notes, and snippets.

@skanev
Created December 4, 2010 16:55
Show Gist options
  • Select an option

  • Save skanev/728317 to your computer and use it in GitHub Desktop.

Select an option

Save skanev/728317 to your computer and use it in GitHub Desktop.
The epic fight between inheritance and type systems, in pseudo-Scala
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