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

Don't use an impl when 'extend impl' is an error #4935

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

danakj
Copy link
Contributor

@danakj danakj commented Feb 12, 2025

If 'extend impl' is invalid, mark the impl as invalid by putting an ErrorInst in the witness_id field.

The construction of the witness_id can otherwise return an ErrorInst but impl lookup was not checking for that. Now have impl lookup check for an error there before attempting to deduce generic parameters, which avoids infinite recursion through deduction in cases like a cyclical impl of itself.

Adds a testcase for infinite impl-of-itself lookup found by fuzzer.

@github-actions github-actions bot requested a review from geoffromer February 12, 2025 18:01
@danakj danakj requested a review from josh11b February 12, 2025 18:02
If 'extend impl' is invalid, mark the impl as invalid by putting an
ErrorInst in the witness_id field.

The construction of the witness_id can otherwise return an ErrorInst but
impl lookup was not checking for that. Now have impl lookup check for an
error there before attempting to deduce generic parameters, which avoids
infinite recursion through deduction in cases like a cyclical impl of
itself.

Adds a testcase for infinite impl-of-itself lookup found by fuzzer.
@josh11b josh11b added this pull request to the merge queue Feb 12, 2025
Merged via the queue into carbon-language:trunk with commit d6ce8f1 Feb 12, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants