Skip to content

Conversation

@danakj
Copy link
Contributor

@danakj danakj commented Dec 5, 2025

Propagate error state in an extend impl declaration out to the enclosing scope. We can do this generically in ApplyExtendImplAs so we don't have to do it explicitly in other places.

Collapse DiagnoseExtendImplOutsideClass into ApplyExtendImplAs as it had only the one caller and is very small, so this simplifies the code, making ApplyExtendImplAs a clear set of diagnostics. And push the construction of the SpecificConstant down into ApplyExtendImplAs so it is only constructed if it's needed, instead of constructing it and throwing it away in error cases.

Ensure any error in the declaration results in the witness being an ErrorInst so the impl will not be used in impl lookup. This simplifies some branches by combining them into a single if statement.

This is part of #6420 which is being split up into a chain of smaller PRs. It is based on #6467.

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.

1 participant