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

anonymous functions with repeated parameters #3652

Closed
scabug opened this issue Jul 7, 2010 · 2 comments
Closed

anonymous functions with repeated parameters #3652

scabug opened this issue Jul 7, 2010 · 2 comments

Comments

@scabug
Copy link

scabug commented Jul 7, 2010

It looks like it is not possible to create a anonymous function with repeat parameters. The specification does not allow a type followed by a *.

This looks inconsitent to me.

scala> def foo(ss: String*) = println(ss.length)
foo: (ss: String*)Unit

scala> val bar = foo _
bar: (String*) => Unit = <function1>

scala> val doesnotwork = (ss:String*) => println(ss.length)
<console>:1: error: ')' expected but identifier found.
       val doesnotwork = (ss:String*) => println(ss.length)
@scabug
Copy link
Author

scabug commented Jul 7, 2010

Imported From: https://issues.scala-lang.org/browse/SI-3652?orig=1
Reporter: Michael Kebe (michael.kebe)

@scabug
Copy link
Author

scabug commented Jul 13, 2010

@odersky said:
This looks tempting at first, but it would drag in a lot of complexity (you just need to believe me on that one).

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