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

Clarification of precedence of default argument for implicit parameters #5621

Closed
scabug opened this issue Mar 27, 2012 · 3 comments
Closed

Comments

@scabug
Copy link

scabug commented Mar 27, 2012

In 4.6 of the Language Ref, I'd suggest to stipulate that "implicit" takes precedence over default arguments as this may not be obvious.

Example:
implicit val i = 1
def f(implicit i: Int = 0) = i
f // 1 as opposite to 0

@scabug
Copy link
Author

scabug commented Mar 27, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5621?orig=1
Reporter: Sonnenschein (sonnenschein)
Affected Versions: 2.9.0

@scabug
Copy link
Author

scabug commented Oct 15, 2013

@gkossakowski said:
Unassigning and rescheduling to M7 as previous deadline was missed.

@scabug
Copy link
Author

scabug commented Mar 9, 2017

@som-snytt said (edited on Mar 10, 2017 5:52:10 PM UTC):
6.6.1 says any param that doesn't have a positional arg must have a default.

Clarification: every param "which is not specified by a positional, named, or implicit argument has a default argument."

Go, Oxford comma.

scala/scala#5767

edit, or something to that effect in 4.6.1.

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

2 participants