-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Check deprecation for getters and setters #15102
Check deprecation for getters and setters #15102
Conversation
@swift-ci Please test |
@swift-ci Please test source compatibility |
@swift-ci Please smoke test compiler performance |
Review ping |
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.
LGTM,
@@ -2341,20 +2360,17 @@ class AvailabilityWalker : public ASTWalker { | |||
/// Walk a member reference expression, checking for availability. | |||
void walkMemberRef(MemberRefExpr *E) { | |||
// Walk the base in a getter context. | |||
// FIXME: We may need to look at the setter too, if we're going to do | |||
// writeback. The AST should have this information. |
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.
We could do something silly here, where we keep track of the operands of InOutExpr
nodes and if E
is in that set, we also check the setter.
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.
I want to use LValueAccessKind if Slava doesn't take it out first! But in a separate PR.
None of them actually depend on TypeChecker; they were just using it as a fast way to get an ASTContext.
This handles the case where just one accessor is deprecated but not the other, which does come up sometimes in Apple's frameworks. rdar://problem/18633725
53b9c79
to
b0e12f4
Compare
@swift-ci Please smoke test |
@swift-ci Please clean smoke test macOS |
@swift-ci Please clean smoke test OS X |
This handles the case where just one accessor is deprecated but not the other, which does come up sometimes in Apple's frameworks.
Not included in this pull request:
foo.bar.baz = 1
)rdar://problem/18633725