title: Ambiguous implicit solution other than sub typing
body: <p>If you run the code below you'll get an <code>ambiguous implicit</code> error:</p>
  
  <pre class="lang-scala prettyprint-override"><code>class Foo[T,I](val msg: I)
  object Foo {
    implicit def provide[T]: Foo[T,String] =
      new Foo("I came from a place you can't touch so subtyping can't help you")
  }
  
  class User
  object User {
    implicit object userFoo extends Foo[User,Int](42)
  }
  
  def fooOf[T,I](U: T)(implicit foo: Foo[T,I]): Foo[T, I] = foo
  
  fooOf(new User).msg //epic fail:
  //Error:(232, 7) ambiguous implicit values:
  //both object userFoo in object User of type A$A153.this.User.userFoo.type
  //and method provide in object Foo of type [T]=&gt; A$A153.this.Foo[T,String]
  //match expected type A$A153.this.Foo[A$A153.this.User,I]
  //fooOf(new User).msg;//
  //^
  </code></pre>
  
  <p>Normally Scala puts the companion object of type <code>T</code>in <code>F[T,I]</code> in priority over <code>F[_]</code>'s. But not in this case since the type <code>I</code> in both defined places differ.(if they were both <code>String</code>, Scala would pick the <code>Foo[User,String]</code> in the <code>User</code> Companion object) </p>
  
  <p>I can't (or better say don't want to) touch the <code>Foo</code> companion object to implement <code>LowerPriorityImplicits</code> subtyping technic and define <code>F[User,I]</code> instances inside it on higher priority level. what else can I do?</p>