Created
October 7, 2017 16:24
-
-
Save knightpop/515f01da908712248e99056594fba8c2 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
object ImplicitOrder extends App{ | |
implicit val implicitIntInstance1: Instance[String] = Instance("Implicit Instance in Same Conjure") | |
def getString(implicit implicitInstance: Instance[String]): String = implicitInstance.value | |
import Imported.implicitIntInstance1 | |
println(getString) | |
} | |
case class Instance[T](value: T) | |
object Instance { | |
implicit val implicitIntInstance1: Instance[String] = Instance("Implicit Instance in Companion Object") | |
} | |
object Imported { | |
implicit val implicitIntInstance1: Instance[String] = Instance("Implicit Instance in imported") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment