-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Eta-expansion of methods with implicit and dependent arguments #5288
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
Comments
The trailing underscore syntax is deprecated, so I would not invest a lot of work in upgrading it. The rest needs work, I agree. Any volunteers for this one? |
If no one else has taken it by the time I'm done with by-name implicits then I will. |
I think we might still need the |
Actually, I ran into an instance of a combination that IIUC is missing in @OlivierBlanvillain's list of test cases: trait A
trait B
type Eta = implicit (a: A) => implicit (b: B) => Unit
def implicitDependent: Eta = { implicitly[B]; implicitly[A]; () } That is, recursive eta expansion on potentially dependent methods. |
I think all fixable things are fixed by now. Adding a regression test that explains what does not work. |
Closes scala#5288 Closes scala#5877 Closes scala#6778
Uh oh!
There was an error while loading. Please reload this page.
They are some inconsistencies between eta-expansion of normal methods and methods with implicit arguments or dependent result type:
So, to turn methods with implicit arguments into function the only option is to give an explicit expected type and not use the underscore syntax:
Dependent methods are also inconsistent, in a different way:
Eta-expansion fails in the presence of explicit return types. Both underscore and non underscore syntax work as expected:
Eta-expansion of dependent methods with two arguments or curried arguments seems to also be broken as the dependency is lost entirely:
Here is the test case I wrote for eta-expansion of all combinations of normal/implicit/dependent methods up to arity 2.
The text was updated successfully, but these errors were encountered: