Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- scala> def f(implicit x: Int) = println(x)
- f: (implicit x: Int)Unit
- scala> f
- <console>:9: error: could not find implicit value for parameter x: Int
- f
- ^
- scala> implicit val x1 = 3
- x1: Int = 3
- scala> f
- 3
- scala> implicit val x2 = 4
- x2: Int = 4
- scala> f
- <console>:11: error: ambiguous implicit values:
- both value x1 of type => Int
- and value x2 of type => Int
- match expected type Int
- f
- ^
- scala>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement