Skip to content
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

Fail self-recursive deferred given impl #22595

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

som-snytt
Copy link
Contributor

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

@som-snytt som-snytt force-pushed the issue/22589-recursive-deferred branch from f7a392f to 58ed9c1 Compare February 13, 2025 02:17
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.

Deferred given in companion object causes infinite recursion
1 participant