Created
May 11, 2016 09:08
-
-
Save asflierl/6cd9c2a12ed77b7d990676676db80c85 to your computer and use it in GitHub Desktop.
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 Meep[A, B](b: B) { def meep(a: A, f: B => B): Option[(B, B)] = Some(b, f(b)) } | |
class Moop extends Meep[Int, String]("meep") { def meep(a: Int)(f: String => String): Option[String] = super.meep(a, f).map(_._2) } | |
println(new Moop().meep(42, identity).map(_._2)) //witness ClassCastException |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Should fail to compile (with something like
error: name clash between defined and inherited member
), but compiles fine with Scala 2.11.8.