The following code emits a confusing error message, should we reject default values for dependent params of the same block?
class Foo(config: String) {
case class Bar(val x: Int) {
def doThings: String = config //Do whatever here
}
}
object Test {
def test(foo: Foo, bar: foo.Bar = foo.Bar(5)) = ???
test(new Foo("port"))
}
9 | def test(foo: Foo, bar: foo.Bar = foo.Bar(5)) = ???
| ^^^
| not found: foo
Or we could try to support it: https://docs.scala-lang.org/sips/refer-other-arguments-in-args.html
Most helpful comment
Or we could try to support it: https://docs.scala-lang.org/sips/refer-other-arguments-in-args.html