Skip to content

Use all available context info for healing ambiguous implicits #11274

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 3 commits into from
Feb 3, 2021

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Feb 1, 2021

When retrying after an ambiguous implicit, we now make use of all the
information in the prototype, including ignored parts. We also try
to match formal parameters with actually given arguments.

Fixes #11243
Fixes #5773, which previously was closed with a more detailed error message.

@odersky odersky force-pushed the fix-11243 branch 2 times, most recently from ce08e50 to b847f6f Compare February 1, 2021 20:37
When retrying after an ambiguous implicit, we now make use of all the
information in the prototype, including ignored parts. We also try
to match formal parameters with actually given arguments.

Fixes scala#11243
Fixes scala#5773, which previously was closed with a more detailed error message.
@prolativ
Copy link
Contributor

prolativ commented Feb 2, 2021

Does this by chance also fix #7069?

@odersky
Copy link
Contributor Author

odersky commented Feb 2, 2021

@prolativ Does not look likely.

@odersky
Copy link
Contributor Author

odersky commented Feb 2, 2021

test performance please

@dottybot
Copy link
Member

dottybot commented Feb 2, 2021

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

i"""normalizedCompatible for $poly, $pt = $result
|constraint was: ${ctx.typerState.constraint}
|constraint now: ${newctx.typerState.constraint}""")
val existingVars = ctx.typerState.uninstVars.toSet
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a def or moved inside the if condition to avoid calling toSet unnecessarily.

@smarter smarter assigned odersky and unassigned smarter Feb 2, 2021
@dottybot
Copy link
Member

dottybot commented Feb 2, 2021

Performance test finished successfully:

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

Benchmarks is based on merging with master (524a129)

@odersky odersky merged commit 7ded834 into scala:master Feb 3, 2021
@odersky odersky deleted the fix-11243 branch February 3, 2021 12:09
@Kordyjan Kordyjan added this to the 3.0.0 milestone Aug 2, 2023
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.

Extension method could not be constructed due to ambiguous methods Derived type class instances do not seem to be eligible for extension methods
5 participants