title: type inference is smart enough to figure out the type when the type is operated with other type
body: <p>Assume this type inference code for infer Element in the List,</p>
  
  <pre><code>def doStuff[A](x: List[A]) = x // ignore the result 
  
  doStuff(List(3)) // I dont need to speicify the type Int here
  </code></pre>
  
  <p>However, if the type A is operated with other type, the type inference is not working, I have to specify the type.</p>
  
  <pre><code>def doStuff[A, B](x: List[A], f: (B, A) =&gt; B) = {
  
  }
  
  doStuff(List(3), (x: String, y) =&gt; x) //compilation failed, missing parameter type
  doStuff[Int, String](List(3), (x, y) =&gt; x) //compilation fine.
  </code></pre>
  
  <p>May I know why is that ?</p>
  
  <p>Many thanks in advance</p>