Skip to content

Inconsistent named arguments #1704

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
dennisqi opened this issue Jun 10, 2020 · 2 comments
Closed

Inconsistent named arguments #1704

dennisqi opened this issue Jun 10, 2020 · 2 comments

Comments

@dennisqi
Copy link
Contributor

In section Class I found we have a named argument:

val point2 = new Point(y=2)

However in section Named Arguments and Default Parameter Values we have:

printName(first = "John", last = "Smith")  // Prints "John Smith"

and

val point1 = new Point(y = 1)

I suppose the val point2 = new Point(y=2) is the convention (no space between the argument and the value). It would be great if we can make it consistent.

@SethTisue
Copy link
Member

SethTisue commented Jun 10, 2020

As per https://docs.scala-lang.org/style/method-invocation.html , the style with the spaces is actually more standard.

A pull request that made the tour use the spaces consistently would be welcome.

@SethTisue
Copy link
Member

fixed by #1707

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