Skip to content

Context queries: Ambiguity between given argument and call to apply() #5966

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

Closed
eichholz opened this issue Feb 21, 2019 · 0 comments
Closed
Labels

Comments

@eichholz
Copy link

Given a function definition

def foo = given (v: Int) => (x: Int) => v + x
implied myInt for Int = 4

Both foo.apply(7) and (foo given 4)(7) works fine, but foo(7) fails to compile (method apply in trait ImplicitFunction1 does not take more parameters).

Tested with Dotty 0.13.0-RC1 and 0.14.0-bin-20190220-60c4bf8-NIGHTLY.

odersky added a commit to dotty-staging/dotty that referenced this issue Feb 22, 2019
`insertApplyOrImplicit` checks whether we already have an inserted apply
in order to prevent an infinite insertion sequence. This criterion should
be restricted to just look at Select nodes. Once an inserted `apply`
is in fact applied it should not count anymore.

Also: Fix printing of FunProtos for "given" arguments.
smarter added a commit that referenced this issue Feb 22, 2019
Fix #5966: Narrow criterion for when we have an inserted apply
odersky added a commit to dotty-staging/dotty that referenced this issue Mar 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants