-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fail self-recursive deferred given impl #22595
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
base: main
Are you sure you want to change the base?
Conversation
f7a392f
to
58ed9c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also squash everything in a single commit
58ed9c1
to
afceb68
Compare
It's harder for me to re-review in squashed form. It looks like a minor refactor to reuse the reporting and also make the I guess "squash, rebase, merge" preserves history as long as possible. It would be great if github had a feature to create an |
71f28fd
to
8a695b8
Compare
8a695b8
to
3a31a9c
Compare
rebased |
3a31a9c
to
2bc6e63
Compare
Refactored Also refactored the previous warning to That was three months ago. |
At typer, fail if implementing a deferred given picks the implementing member, which can happen in the companion to the type class.
The recursion is not detected by
CheckLoopingImplicits
, where a warning might have sufficed, because the RHS gets the symbol of the deferred member and not its implementation.It behooves typer to refuse to infer the member in this case.
The feature is intended to reduce boilerplate where the implicit value is found in lexical scope, so that not too much magic is demanded.
Fixes #22589