SI-7187 deprecate eta-expansion of zero-arg method values [ci: last-only]#5309
SI-7187 deprecate eta-expansion of zero-arg method values [ci: last-only]#5309adriaanm wants to merge 2 commits intoscala:2.12.xfrom
Conversation
|
The tests are not passing! Looks like there's an issue with sbt reporting a failed run to jenkins. |
|
So, are we okay deprecating this fine piece of code? |
... and not grep's exit code, which would mean the test suite's result is determined by whether grep fails or not, instead of partest/junit's hard work
For backwards compatiblity with 2.11, we already don't adapt a zero-arg method value to a SAM. In 2.13, we won't do any eta-expansion for zero-arg method values, but we should deprecate first.
|
not sure.. the example doesn't look bad. i guess the goal is to fix some other examples that are unwanted / trip up users. can we narrow them down more? |
|
I assume |
|
Do you mean to deprecate |
|
No, I meant eta-expanding to that function type (and others with an empty argument list) :-) |
|
I was referring to stefan's comment above mine - maybe I misunderstood. |
|
We clearly need more threading :-) |
|
No, only eta-expanding these types. I generally use types of the form |
|
For me, I would naturally define |
|
Yes, this is probably one of those cases where you want to be explicit. So you'd have to write: I think I'd prefer this version: Both of these should still be allowed, right? |
|
right. that is probably a fair price to pay. didn't we also have recent discussions about deprecating explicit eta-expansion through |
|
Thanks for making my question more explicit, Stefan. I would agree the |
|
OK, I read through the ticket and some more history, I agree we should get this deprecation in. The current patch also warns on explicit eta-expansion: |
|
added distinction between |
For backwards compatiblity with 2.11, we already
don't adapt a zero-arg method value to a SAM.
In 2.13, we won't do any eta-expansion for zero-arg method values,
but we should deprecate first.
JIRA: https://issues.scala-lang.org/browse/SI-7187