Created
February 11, 2017 07:41
-
-
Save vvviiimmm/ab4e4f78730408a85704dc084e2a2328 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
implicit val bob = "Bob" | |
implicit val alice = "Alice" | |
def greet(implicit name: String) = { | |
println(s"Hello, $name!") | |
} | |
// usage | |
greet | |
// ambiguous implicit values: | |
// both value bob in object Main of type => String | |
// and value alice in object Main of type => String | |
// match expected type String | |
// greet | |
// ^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment