Why can\'t I have type parameters in my factory methods below?
import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner import org.scalatest.Fu
Just add ClassManifest context bound:
ClassManifest
def apply[T, U: ClassManifest](arr: Array[T], f: T => U): Bucket[U] = new Bucket[U](arr.map(b => f(b))) def apply[T: ClassManifest](arr: Array[String], f: String => T): Bucket[T] = new Bucket[T](arr.map(b => f(b)))
For details check this and this