Skip to content

Infer missing implicit args in using clause #9347

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

Merged
merged 4 commits into from
Jul 12, 2020

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jul 11, 2020

If there are some missing arguments in a using argument clause, infer them
with implicit search.

odersky added 4 commits July 11, 2020 12:33
If there are some missing arguments in a using argument clause, infer them
with implicit search.
isImplicitMethod is implied by isContextualMethod, no need to test the two separately.
In a using argument clause with missing arguments:

 - resolve to defaults first,
 - only if that fails, do an implicit argument search.

This is the same as if all implicit parameters `x: T` that
did not have an explicit default now are given one like this:

  x: T = summon[T]
@odersky
Copy link
Contributor Author

odersky commented Jul 11, 2020

test performance please

@dottybot
Copy link
Member

performance test scheduled: 1 job(s) in queue, 0 running.

@dottybot
Copy link
Member

Performance test finished successfully:

Visit http://dotty-bench.epfl.ch/9347/ to see the changes.

Benchmarks is based on merging with master (a162b7b)

@odersky
Copy link
Contributor Author

odersky commented Jul 12, 2020

@nicolasstucki Can you do another boostrap compiler with this PR once it is merged? I want to do a test to move all phase info out of contexts into a separate variable. I hope this can speed up the compiler since then (1) we use fewer contexts (about half as many with some additional tweaks) and (2) we are faster in the hot paths where we need to get the current phase id.

I am now at a position where it's mostly a global search and replace. (using Context) becomes (using Context, Period). But we also have 425 occurrences of using argument clauses. With this PR merged we need to update very few of them.

@nicolasstucki nicolasstucki merged commit 7ed93ad into scala:master Jul 12, 2020
@nicolasstucki nicolasstucki deleted the change-infer-implicit branch July 12, 2020 11:39
@nicolasstucki
Copy link
Contributor

I'll rebootstrap tomorrow

@nicolasstucki
Copy link
Contributor

Included in #9356

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants