title: Scala typing with implicits gives typing error
body: <p>I'm trying to implement this:</p>
  
  <pre><code>def buildQuery() {
    val restrictions: ConjunctionRestriction[String, Int] =
      ("name" is "Some One") and ("age" is 20)
  }
  
  implicit def stringToEqualsRestrictionBuilder[T](fieldName: String)
                                                  : EqualsRestrictionBuilder[T] =
    new EqualsRestrictionBuilder[T](fieldName)
  
  implicit def restrictionToConjunctionBuilder[L,R](restriction: Restriction[L])
                                                   : ConjunctionBuilder[L,R] =
    new ConjunctionBuilder[L,R](restriction)
  
  case class Restrictions(restrictions: Restriction[_]*)
  
  trait Restriction[T] {
    def toString: String
  }
  
  class EqualsRestriction[T](val fieldName: String, val value: T)
      extends Restriction[T] {
    override def toString = fieldName + "=" + value
  }
  
  class ConjunctionRestriction[A,B](val lhs: Restriction[A],
                                    val rhs: Restriction[B]) 
      extends Restriction[(A,B)] {
    override def toString = "(" + lhs + ") AND (" + rhs + ")"
  }
  
  class EqualsRestrictionBuilder[T](val fieldName: String,
                                    val restriction: Option[Restriction[T]] = None) {
  
    def is(value: Int) =
      new EqualsRestriction[Int](fieldName, value)
  
    def is(value: String) =
      new EqualsRestriction[String](fieldName, "\"" + value + "\"")
  }
  
  class ConjunctionBuilder[L,R](val lhs: Restriction[L]) {
    def and(rhs: Restriction[R]) = new ConjunctionRestriction[L,R](lhs, rhs)
  }
  </code></pre>
  
  <p>The compiler gives me error:</p>
  
  <pre><code>error: type mismatch;
  found   : MyOuterClass.this.EqualsRestriction[Int]
  required: MyOuterClass.this.Restriction[R]
  val restrictions: ConjunctionRestriction[String, Int] =
    ("name" is "Some One") and ("age" is 20)
  </code></pre>
  
  <p>I havn't had the scala type system all figured out. what is wrong with this?</p>
  
  <p>Thanks</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Fixed by changing ConjunctionBuilder to have only one parameter type L:</p>
  
  <pre><code>class ConjunctionBuilder[L](val lhs: Restriction[L]) {
    def and[R](rhs: Restriction[R]) = new ConjunctionRestriction[L,R](lhs, rhs)
  }
  
  implicit def restrictionToConjunctionBuilder[L](restriction: Restriction[L])
                                                 : ConjunctionBuilder[L] =
    new ConjunctionBuilder[L](restriction)
  </code></pre>
  
  <p>But could someone explain why with the R parameter type, the compile fails?</p>