There is this post discussing the chain of implications, but I think this does not apply to my case, because I have common signs. An example project showing the problem is here . To reproduce these , two lines should be commented on.
So, I have a number of implicits vals for specific types such as
implicit val ObjectIdColumnType: ColumnType[ObjectId] = MappedColumnType.base[ObjectId, Array[Byte]](
{ obj => obj.toByteArray }, { arr => new ObjectId(arr) }
)
I would like all of them to automatically generate implicit vals. So I wrote the following function
implicit def getResultForTypedTypes[T](implicit bct: ColumnType[T]): GetResult[T] =
GetResult[T](r => bct.getValue(r.rs, r.currentPos))
and I expect a function with a prototype like
def << [T](implicit f: GetResult[T]): T = f(this)
will be able to choose GetResult[ObjectId]
Sorry, I am getting an error
Error:(78, 20) could not find implicit value for parameter f: slick.jdbc.GetResult[org.bson.types.ObjectId]
val id = r.<<[ObjectId]
^
I turned on log-implicits and found that a seemingly unbound implicit gets in the way
Information:(78, 20) getResultForTypedTypes is not a valid implicit value for slick.jdbc.GetResult[org.bson.types.ObjectId] because:
hasMatchingSymbol reported error: ambiguous implicit values:
both value strListTypeMapper in object MyAPI of type => co.greenhouse.rabbit.server.db.MyPostgresDriver.DriverJdbcType[List[String]]
and value ObjectIdColumnType in object MyAPI of type => co.greenhouse.rabbit.server.db.MyPostgresDriver.BaseColumnType[org.bson.types.ObjectId]
match expected type co.greenhouse.rabbit.server.db.MyPostgresDriver.api.BaseColumnType[T]
val id = r.<<[ObjectId]
^
implicits?