... and what happens if you have more than one implicit? IIRC that's when it complains, as you have the same name
-
-
-
no problem implicit val __: Show[String] = _.toString implicit val ___: Show[Float] = _.toString implicit val ______________: Show[Long] = _.toString and so on :)
End of conversation
New conversation -
-
-
Thank you! Good to know.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Yup, this is a scarily bad feature. Run into it several times over the last few years. The needs to be a way to get an implicit into local search scope without naming it
-
.
@mpilquist's has got your back:https://github.com/mpilquist/local-implicits … - Show replies
New conversation -
-
-
How about this: implicit val `Show[Int]`: Show[Int] = _.toString
-
Pragmatic.
- Show replies
New conversation -
-
-
yay! what version?
-
It's in 2.12.8 but not in 2.11.12. More than that, I know not...
- Show replies
New conversation -
-
-
What if we need two implicits?
-
Then everything comes unstuck, unfortunately. They both end up being called ‘_’, accessible via backticks, but one shadows the other. See
@virus_dave's reply for a fair analysis of this aspect of it!
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.