title: Implicit resolution from trait
body: <p>I have a use case similar to the situation following:</p>
  
  <pre><code>trait A {
    implicit val x = "hello"
  }
  
  class B {
  
    // somehow bring x into scope here???
  
    def run(x: Int)(implicit y: String) = y + x
  }
  
  println((new B).run(3))
  </code></pre>
  
  <p>I understand that I need to bring <code>x</code> defined in the trait in the implicit scope of B. I've already tried the following:</p>
  
  <pre><code># attempt 1 #
  class B extends A { .... } /// doesn't work
  
  # attempt 2 #
  class B extends A {
  
    val x1 = implicitly[String]  /// doesn't work either
  
    def run(x: Int)(implicit y: String) = y + x
  }
  </code></pre>
  
  <p>Please explain what am I missing here (or, point me to relevant theory topic which I can study, fairly new to scala).</p>