We are getting inconsistent results using Salat 0.08, Scala 2.9.1 and SBT
0.11.3 on various computers. Here is one of the DOA definitions, defined in
a trait called BooksCollection:
class BooksDAO extends SalatDAO[Book, String](collection = booksCollection)
Here is the problem statement:
booksDAO.update[MongoDBObject](MongoDBObject(CommonAttrs.ID -> b.id), b,
true, false, WriteConcern.Safe)
On Mac Snow Leopard, the code compiles fine.
On Linux 11.04, we get:
[error] /blah/src/main/scala/com/blah/mongo/DomainCollections.scala:89:
overloaded method value update with alternatives:
[error] (q: com.mongodb.DBObject,o: com.mongodb.DBObject,upsert:
Boolean,multi: Boolean,wc: com.mongodb.WriteConcern)Unit <and>
[error] (q: com.mongodb.DBObject,t: com.bookish.domain.Book,upsert:
Boolean,multi: Boolean,wc: com.mongodb.WriteConcern)Unit
[error] does not take type parameters
[error] def upsertBook(b: Book) = booksDAO.update[MongoDBObject](MongoDBObject(CommonAttrs.ID
-> b.id), b, true, false, WriteConcern.Safe)
If we remove [MongoDBObject], the code now compiles fine on Linux but not
Mac. The error on Mac is:
error: ambiguous reference to overloaded definition,
both method update in class SalatDAO of type [A, B](q: A, o: B, upsert:
Boolean, multi: Boolean, wc: com.mongodb.WriteConcern)(implicit evidence$6:
A => com.mongodb.DBObject, implicit evidence$7: B =>
com.mongodb.DBObject)Unit
and method update in trait BaseDAOMethods of type [A](q: A, t:
com.blah.Book, upsert: Boolean, multi: Boolean, wc:
com.mongodb.WriteConcern)(implicit evidence$8: A =>
com.mongodb.DBObject)Unit
match argument types
(com.mongodb.casbah.commons.Imports.DBObject,com.blah.Book,Boolean,Boolean, com.mongodb.WriteConcern)
booksDAO.update(MongoDBObject(CommonAttrs.ID -> b.id), b, true, false,
WriteConcern.Safe)
Suggestions as to what the root problem is, and how to solve?
Mike