title: Scala generic method - No ClassTag available for T
body: <p>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.</p>
  
  <pre><code>scala&gt; def foo[T](count: Int, value: T): Array[T] = Array.fill[T](count)(value)
  &lt;console&gt;:7: error: No ClassTag available for T
         def foo[T](count: Int, value: T): Array[T] = Array.fill[T](count)(value)
                                                                          ^
  </code></pre>
  
  <p>Thanks in advance for help in understanding what is wrong here and how to make this contrived example work.</p>