Avoiding implicit def ambiguity in Scala

后端 未结 6 1316
悲哀的现实
悲哀的现实 2021-01-07 23:27

I am trying to create an implicit conversion from any type (say, Int) to a String...

An implicit conversion to String means RichString methods (like reverse) are not

6条回答
  •  孤街浪徒
    2021-01-07 23:58

    I'm confused: can't you use .toString on any type anyway thus avoiding the need for implicit conversions?

提交回复
热议问题