class Test {
import scala.collection._
class Parent
class Child extends Parent
implicit val children = mutable.Map[String, Child]()
def createEntities[T <: Parent](names: String*) = names.foreach(createEntity[T])
def createEntity[T <: Parent](name: String)(implicit map: mutable.Map[String, T]): Unit = map.get(name) match {
case None => println( name + " not defined.")
case _ =>
}
}
Why the compiler complains:
error: could not find implicit value for parameter map: scala.collection.mutable.Map[String,T] names.foreach(createEntity[T])
?