title: Why can't a variable be assigned placeholder in function literal?
body: <p>I'm having trouble understanding underscores in function literals.</p>
  
  <pre><code>val l = List(1,2,3,4,5)
  l.filter(_ &gt; 0)
  </code></pre>
  
  <p>works fine</p>
  
  <pre><code>l.filter({_ &gt; 0})
  </code></pre>
  
  <p>works fine</p>
  
  <pre><code>l.filter({val x=1; 1+_+3 &gt; 0}) // ie you can have multiple statements in your function literal and use the underscore not just in the first statement.
  </code></pre>
  
  <p>works fine</p>
  
  <p>And yet:</p>
  
  <pre><code>l.filter({val x=_; x &gt; 0})
  e&gt;:1: error: unbound placeholder parameter
  l.filter({val x=_; x &gt; 0})
  </code></pre>
  
  <p>I can't assign the <code>_</code> to a variable, even though the following is legal function literal:</p>
  
  <pre><code>l.filter(y =&gt; {val x=y; x &gt; 0})
  </code></pre>
  
  <p>works fine.</p>
  
  <p>What gives? Is my 'val x=_' getting interpreted as something else? Thanks!</p>