I have this Datasource trait
trait DataSource {
def insert[T](foo: Foo): Either[Exception, Future[T]]
}
Then I create an implementation like:
class MongoDataSource(collection: MongoCollection[Document]) extends DataSource {
override def insert[ManagedObject](doc: ManagedObject): Either[Exception, Future[ManagedObject]] = {
Right(Future(new ManagedObject("")))
}
}
I got error :
class type required but ManagedObject found
Right(Future(new ManagedObject("")))