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

mcku picture mcku  路  3Comments

LaymanMergen picture LaymanMergen  路  3Comments

adamgfraser picture adamgfraser  路  3Comments

fommil picture fommil  路  3Comments

m-sp picture m-sp  路  3Comments