Slick 3.1.1 ambiguous implicit values involving filter and implicit CanBeQueryCondition
<p>I have been trying to create a Generic Dao over Slick 3.1.1 and it includes a generic filter that competes with JPA's <code>findByExample</code>, see the following files:</p>

<ul>
<li><a href="https://github.com/bravegag/play-authenticate-usage-scala/blob/master/app/dao/GenericDaoImpl.scala#L49" rel="nofollow noreferrer">GenericDaoImpl.scala</a> Generic level reusable across all Models </li>
<li><a href="https://github.com/bravegag/play-authenticate-usage-scala/blob/master/app/dao/UserDao.scala" rel="nofollow noreferrer">UserDao.scala</a> Generic plus customizations for the User model</li>
<li><a href="https://github.com/bravegag/play-authenticate-usage-scala/blob/master/app/services/UserService.scala#L34" rel="nofollow noreferrer">UserService.scala</a> Wraps the UserDao into more services level functionality</li>
</ul>

<p>In this last file I try to use the generic filter function to find a user by its registered email, like this:</p>

<pre><code>// this will implicitly exec and wait indefinitely for the 
// db.run Future to complete
import dao.ExecHelper._ 

def findByEmail(email: String): Option[UserRow] = {
  userDao.filter(_.email === email).headOption
}
</code></pre>

<p>but this produces the compiler error:</p>

<pre><code>[error] /home/bravegag/code/play-authenticate-usage-scala/app/services/UserService.scala:35: value === is not a member of String
[error]     userDao.filter(email === _.email).headOption
[error]                          ^
[error] /home/bravegag/code/play-authenticate-usage-scala/app/services/UserService.scala:35: ambiguous implicit values:
[error]  both value BooleanOptionColumnCanBeQueryCondition in object CanBeQueryCondition of type =&gt; slick.lifted.CanBeQueryCondition[slick.lifted.Rep[Option[Boolean]]]
[error]  and value BooleanCanBeQueryCondition in object CanBeQueryCondition of type =&gt; slick.lifted.CanBeQueryCondition[Boolean]
[error]  match expected type slick.lifted.CanBeQueryCondition[Nothing]
[error]     userDao.filter(email === _.email).headOption
[error]                   ^
</code></pre>

<p>Can anyone advice on how the implicit declaration of the <code>filter</code> function below can be improved to solve this compiler error?</p>

<p>The implementation of the filter function (found in <a href="https://github.com/bravegag/play-authenticate-usage-scala/blob/master/app/dao/GenericDaoImpl.scala#L49" rel="nofollow noreferrer">GenericDaoImpl.scala</a>) is:</p>

<pre><code>// T is defined above as T &lt;: Table[E] with IdentifyableTable[PK]

override def filter[C &lt;: Rep[_]](expr: T =&gt; C)
  (implicit wt: CanBeQueryCondition[C]) : Future[Seq[E]] = 
    db.run(tableQuery.filter(expr).result)
</code></pre>