3

I have a method that accepts an implicit parameter and somewhere in the code that implicit value has been defined. However I haven't been able to find where my code has created it.

Is there an easy way to find where an implicit value has been defined in Scala? So far I'm just scanning the source code of my imports but this is extremely tedious. I am using IntelliJ.

juan2raid
  • 1,606
  • 1
  • 18
  • 29

1 Answers1

9

Intellij scala plugin has recently added feature to display implicits explicitly :)

You can press ctl+alt+shift+++ to display implicits.

Or Refer answer from Travis Brown here. Small snippet from his answer :

scala> import scala.reflect.runtime.universe.reify
import scala.reflect.runtime.universe.reify

scala> reify("a" * 3).tree
res6: reflect.runtime.universe.Tree = Predef.augmentString("a").$times(3)
Pritam Kadam
  • 2,388
  • 8
  • 16