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

Method values with repetead parameters are not specified. Also it looks like a hack. #5116

Closed
scabug opened this issue Oct 26, 2011 · 2 comments

Comments

@scabug
Copy link

scabug commented Oct 26, 2011

Problem is that following code is legal (this is not specified in section 6.7):

trait SumExample {
  def sum(x: Int*) = x.sum
  val fun = sum _
  fun(1, 2, 3)
}

Also it's strange that there is no presentation in code for type Int* => Int.
So Scala should have syntax like (x: Int*) => x.sum for function literals. And this should be syntax sugar for type like FunctionSeq1[Int, Int] {def apply(x: Int*): Int = x.sum}.
Or this should be removed from language. For example sum _ can have type Seq[Int] => Int.

@scabug
Copy link
Author

scabug commented Oct 26, 2011

Imported From: https://issues.scala-lang.org/browse/SI-5116?orig=1
Reporter: @Alefas
Affected Versions: 2.9.1
Duplicates #4176

@scabug
Copy link
Author

scabug commented Oct 26, 2011

@retronym said:
Dup of #4176, which was recently resolved [1]

[1] https://codereview.scala-lang.org/fisheye/changelog/scala-svn?cs=25809

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