Skip to content

Instantly share code, notes, and snippets.

@bergmark
Last active October 17, 2017 11:21
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
trait Foo[A]
object A {
implicit val foo: Foo[Int] = new Foo[Int] {}
}
object B {
implicit val foo: Foo[String] = new Foo[String] {}
}
object C {
import A._
import B._
// Whoops, the implicits have the same name so neither will resolve.
implicitly[Foo[Int]]
implicitly[Foo[String]]
}
trait Foo[A]
case class A()
object A {
implicit val foo: Foo[A] = new Foo[A] {}
}
case class B()
object B {
implicit val foo: Foo[B] = new Foo[B] {}
}
object C {
implicitly[Foo[A]]
implicitly[Foo[B]]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment