Skip to content

Error with dependent parameters with default values #4419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
liufengyun opened this issue Apr 30, 2018 · 0 comments
Closed

Error with dependent parameters with default values #4419

liufengyun opened this issue Apr 30, 2018 · 0 comments

Comments

@liufengyun
Copy link
Contributor

The following code is rejected by Dotty, but accepted by Scalac:

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"))()
}

The error message:

11 |  test(new Foo("port"))()
   |  ^^^^^^^^^^^^^^^^^^^^^
   |  found:    foo$1.Bar
   |  required: ?1.Bar
   |
   |  where:    ?1 is an unknown value of type Foo
@liufengyun liufengyun self-assigned this Apr 30, 2018
liufengyun added a commit to dotty-staging/dotty that referenced this issue May 1, 2018
WIP - tests/pos/pickleinf.scala still fails
liufengyun added a commit to dotty-staging/dotty that referenced this issue May 1, 2018
WIP - tests/pos/pickleinf.scala still fails
liufengyun added a commit to dotty-staging/dotty that referenced this issue May 1, 2018
odersky added a commit that referenced this issue May 28, 2018
Fix #4419: liftFun should also update method parameter types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant