Skip to content
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

type mismatch on dependent method with default arguments #9333

Closed
scabug opened this issue May 27, 2015 · 4 comments
Closed

type mismatch on dependent method with default arguments #9333

scabug opened this issue May 27, 2015 · 4 comments

Comments

@scabug
Copy link

scabug commented May 27, 2015

class A{case class B()}
def f(a: A)(b : a.B, c: Int = 0) = 0
val a = new A
f(a)(a.B())

results in

<console>:15: error: type mismatch;
 found   : a.B
 required: x$1.B
Error occurred in an application involving default arguments.
              f(a)(a.B())

Removing the default parameter, or moving it to the first parameter list makes the problem disappear.

@scabug
Copy link
Author

scabug commented May 27, 2015

Imported From: https://issues.scala-lang.org/browse/SI-9333?orig=1
Reporter: Patrick Premont (ppremont)
Affected Versions: 2.11.6
See #7234, #7371

@scabug
Copy link
Author

scabug commented May 28, 2015

@retronym said:
Duplicate of #7371 and/or #7234.

@scabug scabug closed this as completed May 28, 2015
@scabug
Copy link
Author

scabug commented May 28, 2015

Patrick Premont (ppremont) said:
Sorry about the duplicate. I had only searched for "type mismatch" errors.

@som-snytt
Copy link

specifically #7234 which is not fixed

Looking at the two tickets side-by-side is like the old children's puzzle, spot the difference!

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

3 participants