Here's two piece of example code, found here:
scala> val im = m.reflect(new C)
im: reflect.runtime.universe.InstanceMirror = instance mirror for C@3442299e
and here:
scala> def mkArray[T : ClassTag](elems: T*) = Array[T](elems: _*)
the first piece of code uses a method defined in scala.reflect.api.Mirrors (found here):
abstract def reflect[T](obj: T)(implicit arg0: ClassTag[T]): Universe.InstanceMirror
if you notice, there's a ClassTag
used like ClassTag[T]
and one used like ClassTag
. What's the reason for the difference?