-
Notifications
You must be signed in to change notification settings - Fork 21
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
Function parameter types not inferred in the presence of default arguments #11322
Comments
@adriaanm shall we milestone this for RC1, or not? |
I don’t think I’ll be able to add support for named/defaults by the RC. let’s schedule for 2.13.1 |
There's already the issue that you can't invoke scala> def foo(x: Int = 1) = x.toString
def foo(x: Int): String
scala> foo
^
error: missing argument list for method foo
Unapplied methods are only converted to functions when a function type is expected.
You can make this conversion explicit by writing `foo _` or `foo(_)` instead of `foo`. |
that's as expected, I think, since Dotty aims to eliminate any need for Starting dotty REPL...
scala> def foo(x: Int = 1) = x.toString
def foo(x: Int): String
def foo$default$1: Int
scala> foo
val res0: Int => String = Lambda$1223/289710123@13ef7fa1 but it's kind of a tangent, since this ticket is about lambdas, not about eta-expansion per se. I will re-title the ticket not to refer to "eta expansion". |
Seems like scala/scala#7340 missed a case; I would expect eta expansion to work for both
The text was updated successfully, but these errors were encountered: