Skip to content

[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

Merged
merged 1 commit into from
Nov 27, 2018

Conversation

jrose-apple
Copy link
Contributor

...even if they're depended on by protocols we conform to.

const NominalTypeDecl *nominal,
ProtocolDecl *proto) {
SmallVector<ProtocolConformance *, 4> conformances;
nominal->lookupConformance(M, proto, conformances);
Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor Author

@jrose-apple jrose-apple Nov 26, 2018

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.

Copy link
Contributor Author

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.

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test

...even if they're depended on by protocols we conform to.
@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test

@jrose-apple jrose-apple merged commit 9f6de1f into swiftlang:master Nov 27, 2018
@jrose-apple jrose-apple deleted the nacho-conformance branch November 27, 2018 01:38
jrose-apple added a commit to jrose-apple/swift that referenced this pull request Dec 12, 2018
…ftlang#20657)

...even if they're depended on by protocols we conform to.

(cherry picked from commit 9f6de1f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants