Find all implicits

后端 未结 2 769
孤独总比滥情好
孤独总比滥情好 2020-12-16 13:38

Is there a way in Scala to find and display all uses of implicits in my code, or compile without implicits enabled (so I get compilation errors)? I\'m hoping to identify pla

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-16 14:21

    As of yesterday (it's just a coincidence) there is -Xlog-implicit-conversions.

    scalac -Xlog-implicit-conversions -d /tmp /scala/trunk/src/library/scala/util/Random.scala 
    /scala/trunk/src/library/scala/util/Random.scala:115: applied implicit conversion from Int to ?{val to: ?} = implicit def intWrapper(x: Int): scala.runtime.RichInt
        for (n <- buf.length to 2 by -1) {
                      ^
    

提交回复
热议问题