title: Error not Found value in function param which references other function param
body: <p>This curried version works fine. Link to Scastie <a href="https://scastie.scala-lang.org/pckrishnadas88/XPNEYCtFTnOdHhsSbABJjg" rel="nofollow noreferrer">View code in action</a></p>
  
  <pre><code>def foo(a: Int)(b: Int = a-1): Int = a + b
  foo(9)()
  </code></pre>
  
  <p>But this version throws the Error not found value a. Link to Scastie. <a href="https://scastie.scala-lang.org/pckrishnadas88/wvWD19RgRlqFn6DnP1RyOA" rel="nofollow noreferrer">View code in action</a></p>
  
  <pre><code>def bar(a: Int, b: Int = a-1): Int = a+b
  bar(9)
  </code></pre>
  
  <p>Is this an actual error or is there any reason why it is not working?</p>