-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SymbolGraphGen] refactor protocol conformance inheritance checking #66012
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
[SymbolGraphGen] refactor protocol conformance inheritance checking #66012
Conversation
rdar://109418762
@swift-ci Please smoke test |
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, thanks for fixing this!
It would be great if you could add a check in the test that connects the name of the symbols with their mangled name or at least annotate source and target with the readable names. Otherwise I can only guess what the target/source is.
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.
You can also have a BoundGenericClassType or ParameterizedProtocolType:
protocol P: C<Int> {}
protocol Q: Iterator<Int> {}
But if you want a flat list of inherited protocols without the superclass or any sugar, call ProtocolDecl::getInheritedProtocols() instead of getInherited().
Similarly to get the “semantic” protocols for an ExtensionDecl, call getLocalConformances() and then getProtocol() on each element.
It looks like ParameterizedProtocolTypes still resolve down to ProtocolDecls via the |
… and getInheritedProtocols
@swift-ci Please smoke test |
Resolves rdar://109418762
When a protocol has a class inheritance requirement, and a conformance to that protocol is added via an extension, the code that checks for additional protocols currently crashes due to assuming it will only need to handle protocols and protocol compositions. This PR updates that code to gracefully handle class inheritance requirements by simply skipping them - that information is already handled elsewhere.