title: PartialFunction with recursion
body: <p>I have written this code sample:</p>
  
  <pre class="lang-scala prettyprint-override"><code>val fact: PartialFunction[Int, Int] = {
    case 0 =&gt; 1
    case n if n &gt; 0 =&gt; n * fact(n-1)
  }
  </code></pre>
  
  <p>And it fails to compile with an error: <em>forward reference extends over definition of value fact</em>.</p>
  
  <p>So my question is whether a partial function can be recursive? May be there is another syntax for that?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>This error seems to appear only when trying this in Scala Worksheet.</p>