Dotty: Reject default values for dependent params of the same block?

Created on 30 Apr 2018  路  1Comment  路  Source: lampepfl/dotty

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
language enhancement revisit

Most helpful comment

>All comments

Was this page helpful?
0 / 5 - 0 ratings

Related issues

travisbrown picture travisbrown  路  3Comments

milessabin picture milessabin  路  3Comments

smarter picture smarter  路  3Comments

Blaisorblade picture Blaisorblade  路  3Comments

julienrf picture julienrf  路  3Comments