Skip to content

Offer additional note for why method with Self reference cannot be used on any SomeType #82601

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

SwiftyJoeyy
Copy link

@SwiftyJoeyy SwiftyJoeyy commented Jun 28, 2025

Resolves #76320

Update test cases that emit the could_not_use_member_on_existential error to also check for the associated could_not_use_member_on_existential_note note.
…f-referencing members

Emit the `could_not_use_member_on_existential_note` diagnostic when a member
reference fails due to constraints involving `Self` or associated types that
cannot be resolved on an existential value. This provides more precise guidance
by explicitly referencing types like `Self.A` that appear in the member's
signature or constraints.

The note is emitted after performing member lookup and inspecting viable and
unviable candidates for dependent types rooted in `Self`.

Improves diagnostics for issue: swiftlang#76320

No functional changes outside of diagnostics.
@SwiftyJoeyy
Copy link
Author

@AnthonyLatsis Just a reminder to take a look at this when you're able to 🙏

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.

Offer additional note for why method with Self reference cannot be used on any SomeType
1 participant