Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package quickstart.models.test
- import quickstart.model._
- import com.mongodb.casbah.Imports._
- import scalaz._
- import Scalaz._
- object MongoFun {
- trait SMongoDB {
- self: MongoDB =>
- type SMongoCollection = Validation[String, MongoCollection]
- override def getCollection(collection:String):SMongoCollection = try {
- success((this(collection)))
- } catch {
- case ex => failure(ex.getMessage)
- }
- }
- implicit def toSMongoDB(db:MongoDB) = new MongoDB(db.underlying) with SMongoDB
- }
- [info] Compiling 1 Scala source to /home/eof/Projects/Xitrum/xitrum-new/target/scala-2.9.1/test-classes...
- [error] /home/eof/Projects/Xitrum/xitrum-new/src/test/scala/ModelsSpec.scala:26: overriding method getCollection in class MongoDB of type (name: String)com.mongodb.DBCollection;
- [error] method getCollection in trait SMongoDB of type (collection: String)this.SMongoCollection has incompatible type
- [error] implicit def toSMongoDB(db:MongoDB) = new MongoDB(db.underlying) with SMongoDB
- [error] ^
- [error] one error found
- [error] {file:/home/eof/Projects/Xitrum/xitrum-new/}default-169585/test:compile: Compilation failed
- [error] Total time: 2 s, completed 24-mar-2012 11:17:57
Advertisement
Add Comment
Please, Sign In to add comment