-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Use Swift-3-style access checking to downgrade errors to warnings #6795
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
Use Swift-3-style access checking to downgrade errors to warnings #6795
Conversation
|
Part 1 of 2—a follow-up request will do something similar for availability. Credit to @slavapestov for the idea; I'm just the implementer. @swift-ci Please test |
|
Build failed |
|
Build failed |
|
Bad merge, but shouldn't affect review. Rebasing. |
No functionality change; the value at the place where the callback is invoked is always DowngradeToWarning::No. This will be exercised by the next commit.
...instead of just ignoring the errors in certain cases, in service of source compatibility. Swift 3.0 wasn't nearly as strict as checking access control for types because it didn't look at the TypeRepr at all (except to highlight a particular part of the type in diagnostics). It also looked through typealiases in certain cases. Approximate this behavior by running the access checking logic for Types (rather than TypeReprs), and downgrade access violation errors to warnings when the checks disagree. Part of rdar://problem/29855782.
ed89a62 to
9489f10
Compare
|
@swift-ci Please test |
|
Build failed |
|
Build failed |
|
Looks good! |
| highlightOffendingType(TC, diag, complainRepr); | ||
| // Swift 3.0.0 mistakenly didn't diagnose any issues when the context access | ||
| // scope represented a private or fileprivate level. | ||
| // FIXME: Conditionalize this on Swift 3 mode. |
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.
Does the fixme still apply?
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.
Unfortunately yes, this is a separate issue. It shouldn't be hard but the diagnostics need updating too. It's on my list.
...instead of just ignoring the errors in certain cases, in service of source compatibility.
Swift 3.0 wasn't nearly as strict as checking access control for types because it didn't look at the TypeRepr at all (except to highlight a particular part of the type in diagnostics). It also looked through typealiases in certain cases. Approximate this behavior by running the access checking logic for Types (rather than TypeReprs), and downgrade access violation errors to warnings when the checks disagree.
Part of rdar://problem/29855782.