最佳答案
I'm relatively new to Scala and am trying to define a generic object method. However, when I refer to the parameterized type within the method I am getting "No ClassTag available for T". Here is a contrived example that illustrates the problem.
scala> def foo[T](count: Int, value: T): Array[T] = Array.fill[T](count)(value)
<console>:7: error: No ClassTag available for T
def foo[T](count: Int, value: T): Array[T] = Array.fill[T](count)(value)
^
Thanks in advance for help in understanding what is wrong here and how to make this contrived example work.