Created
September 14, 2014 03:08
-
-
Save paulp/36b67d27400a9f3be96a to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Bippy(override val toString: String) | |
trait A { implicit def lowPriority: Bippy = new Bippy("A") } | |
object B extends A { implicit def highPriority: Bippy = new Bippy("B") } | |
object C { implicit def highPriority: Bippy = new Bippy("C") } | |
object Test { | |
def main(args: Array[String]): Unit = { | |
import B._, C._ | |
println( implicitly[Bippy] ) // Prints: A | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh… wow.