-
Notifications
You must be signed in to change notification settings - Fork 10.6k
migrator: handle AppKit protocol migrations. rdar://42480588 #18226
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
Conversation
|
@swift-ci please smoke test |
|
@swift-ci please smoke test |
|
@nathawes could you please review this patch for swift-4.2-branch? |
lib/Migrator/APIDiffMigratorPass.cpp
Outdated
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.
Is this based purely on the function name at the moment?
If it is, it seems like this migration would cause errors if
- I have my own class with a similarly named, but unrelated method, e.g. 'changeColor(_ color: Color)', that I override in subclass (the subclass' override should be left alone)
- I have a subclass of NSObject and a subclass of that subclass that both override one of these methods (the sub-sub-class' method should still override).
Some of the names seem specific enough that the above wouldn't happen too often in practice, but I could imagine it happening for a few of them.
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.
yeah, I think it is safer to use USR for identifying these overriding function. Will change!
lib/Migrator/APIDiffMigratorPass.cpp
Outdated
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.
Shouldn't this check if the thing it's referencing is one of the targeted methods? E.g. I might be calling some unrelated method on NSObject that I also happen to override and I want to call the super class' version rather than my own.
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.
Good point! I'll add this check for these function invocation.
lib/Migrator/APIDiffMigratorPass.cpp
Outdated
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.
This doesn't seem like the right place for this one. E.g. I might also use super.changeColor() in methods other than my override of changeColor() if I don't want to use my override.
640cbb4 to
5ffb7a3
Compare
|
@nathawes I've addressed your comments above. Mind taking another look? |
nathawes
left a comment
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 Xi! Thanks for updating it.
|
@swift-ci please smoke test |
|
@swift-ci please smoke test |
This is #18226 but with a fix for the test to be macos specific. rdar://42480588
This is #18226 but with a fix for the test to be macos specific. rdar://42480588
rdar://42480588