Skip to content

Instantly share code, notes, and snippets.

@pk11
Created December 11, 2012 14:03
Show Gist options
  • Save pk11/4258783 to your computer and use it in GitHub Desktop.
Save pk11/4258783 to your computer and use it in GitHub Desktop.
iteratee impl
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