Skip to content

Reject incomplete implicit dictionaries #6798

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 1 commit into from
Jul 3, 2019

Conversation

milessabin
Copy link
Contributor

If any RHS of a recursive implicit dictionary (after pruning) is an EmptyTree, then this indicates that implicit search failed and we should report the overall search as a failure.

Fixes #6796.

If any RHS of a recursive implicit dictionary (after pruning) is an
EmptyTree, then this indicates that implicit search failed and we should
report the overall search as a failure.

Fixes scala#6796
@@ -1842,6 +1842,7 @@ final class SearchRoot extends SearchHistory {
val pruned = prune(List(tree), implicitDictionary.map(_._2).toList, Nil)
implicitDictionary0 = null
if (pruned.isEmpty) result
else if (pruned.exists(_._2 == EmptyTree)) NoMatchingImplicitsFailure
Copy link
Member

Choose a reason for hiding this comment

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

Is there a way to provide a more detailed error that would let the user know more about how the search failed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In principle I guess so. But it's not obvious (to me) how to do that.

@milessabin milessabin merged commit e0962b3 into scala:master Jul 3, 2019
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.

Incomplete implicit dictionaries should be rejected
2 participants