title: Different behaviour when wrapping in a method : scala
body: <p>There're two kinds of my code, and it worked:</p>
  
  <p>One uses <code>flatten</code> directly</p>
  
  <pre><code>val list = List(List(1, 2), List(3, 4))
  println(list.flatten)
  </code></pre>
  
  <p>The other use a method</p>
  
  <pre><code>val list = List(List(1, 2), List(3, 4))
  println(flatten(list))
  
  def flatten(list: List[Any]): List[Any] = {
          list.flatten//this is the line 28
  }
  </code></pre>
  
  <p>And there comes an error:</p>
  
  <pre><code>Error:(28, 14) No implicit view available from Any =&gt; scala.collection.GenTraversableOnce[B].
          list.flatten
  
  Error:(28, 14) not enough arguments for method flatten: (implicit asTraversable: Any =&gt; scala.collection.GenTraversableOnce[B])List[B].
  Unspecified value parameter asTraversable.
          list.flatten
  </code></pre>
  
  <p>Why and how to solve it?</p>