-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Use type of function literal param for PF synthesis [ci: last-only] #10486
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
Conversation
f1b44b9
to
e770628
Compare
I considered erroring outright, but I forgot to ask WWDD:
I believe in sports such as chess, it is called a "draw". Only the widened argument type is OK. |
I'll attempt to follow dotty and error hard before undrafting, but opinions welcome. |
I'm in favor of a compiler error for |
footnote
|
e770628
to
453e351
Compare
just a rebase. We'll also address scala/bug#13000 (edit: in a separate PR). The idea was to put the type args behind a bulwark of aliases to prevent warning, rather than tweak refchecks.
|
453e351
to
6782503
Compare
Roll back the "innovation" per the review comment and common sense.
No, there is no such example. |
github is munching on my
|
ef0b161
to
3075d16
Compare
The flaky test.
I wonder if that is also addressed by #10867 |
3075d16
to
f187783
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you!
@lrytz How many beers does this make that I owe you? |
Someone thought they owed me a lot of beer one evening last week and it didn't turn out well for me 🍻 |
When "adapting" a function literal to a
PartialFunction
, don't ignore an explicit parameter type but use it directly.Fixes scala/bug#4940
For edge case syntax,List(42).collect((x: String) => x match { case "42" => 27 })
, use the explicit param type to widen the type arg of the partial function. (Previously it was ignored.) Warn under-Xlint:infer-any
.