-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[ParseableInterface] Don't print conformances from other modules #20657
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
const NominalTypeDecl *nominal, | ||
ProtocolDecl *proto) { | ||
SmallVector<ProtocolConformance *, 4> conformances; | ||
nominal->lookupConformance(M, proto, conformances); |
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.
@DougGregor I wasn't super happy about using this query because it has to build the whole lookup table, but maybe we can assume that's happened by the time we're done compiling a module anyway?
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.
There might be a way to do what you want (printing conformed-to protocols, either directly or via inheritance, for public protocols only) by walking the ConformanceLookupTable directly.
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.
Hm, right. This can still result in a conformance being printed twice. I'll take a look, but that's probably not too much more or less expensive than what I'm doing here once the table is built.
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, given what's there nothing jumps out at me as being better than this.
@swift-ci Please test |
@swift-ci Please smoke test |
...even if they're depended on by protocols we conform to.
16c8227
to
c692173
Compare
@swift-ci Please smoke test |
…ftlang#20657) ...even if they're depended on by protocols we conform to. (cherry picked from commit 9f6de1f)
...even if they're depended on by protocols we conform to.