Created
December 11, 2012 14:03
-
-
Save pk11/4258783 to your computer and use it in GitHub Desktop.
iteratee impl
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
package boo { | |
object Iteratee { | |
import Implicits.internal | |
//clientAPI does not take an implicit, so the closest in scope is resolved | |
def clientAPI(): Unit = println(Future.future) | |
} | |
object Future { | |
def future(implicit ex: String): String = ex | |
} | |
object Implicits { | |
implicit val internal: String = "oh nozz" | |
} | |
} | |
package foo { | |
object Foo { | |
def main(args: Array[String]): Unit = { | |
//this is doing nothing | |
implicit val stringBoo: String = "override" | |
boo.Iteratee.clientAPI() | |
} | |
} | |
} | |
//prints `oh nozz`, not `override` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment