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
Change error diagnosed for when self
isn't available in scope
#59140
Change error diagnosed for when self
isn't available in scope
#59140
Conversation
…tests to reflect change
@AnthonyLatsis test? |
@swift-ci please test |
@hamishknight Fixed compilation errors, try to test it again, also, every test file should have |
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.
Nice!
Yup, every test that needs to run a typecheck over the test file |
Co-authored-by: Hamish Knight <hamish_github@mediocremail.com>
…he string to `self` Co-authored-by: Hamish Knight <hamish_github@mediocremail.com>
@swift-ci please test |
…e a semicolon instead of a comma
@AnthonyLatsis addressed all concerns, could you try test now? |
@swift-ci please smoke test |
@AnthonyLatsis could you ask it to build a toolchain aswell? The tests pass and everything works but I’m just curious to try out locally |
@swift-ci please build toolchain macOS |
@xwu Ready for merge now? |
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.
Looks good, thank you!
@SerenaKit You might want to consider a tailored diagnostic like this for |
@swift-ci please test |
@SerenaKit I'm going to squash this so that we don't pollute the commit history with review-specific amendments. |
As discussed on https://forums.swift.org/t/changing-error-diagnosed-for-when-self-isn-t-available/57616, the purpose of these changes are to hopefully make it more obvious, especially to beginner programmers, what the purpose of
self
is, as these changes will diagnosecannot find
selfin scope, did you mean to declare or extend a type
rather than justcannot find
selfin scope
when self isn't available.