Skip to content

Instantly share code, notes, and snippets.

@vvviiimmm
Created February 11, 2017 07:41
Show Gist options
  • Save vvviiimmm/ab4e4f78730408a85704dc084e2a2328 to your computer and use it in GitHub Desktop.
Save vvviiimmm/ab4e4f78730408a85704dc084e2a2328 to your computer and use it in GitHub Desktop.
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