ASTPrinter: print public inherited protocols of the skipped private protocols #38882
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When printing the list of inherited protocols in the module interface, if private stdlib protocols are requested to be hidden (
PrintOptions::SkipUnderscoredStdlibProtocols
), make sure to print public inherited protocols of the hidden protocols.This is especially noticeable for
NSError
types imported into Swift. For example,CocoaError
is imported with a synthesized conformance to_BridgedStoredNSError
, however, in the module interface generated by SourceKit,_BridgedStoredNSError
is currently hidden from the inheritance list:There is no indication in the module interface that
CocoaError
is anError
and can be thrown. This might cause confusion for someone reading the module interface, and for static analysis tools relying on it.This change improves the module interface generation for synthesized conformances, so that the inheritance list contains all the public conformances that can be observed by the user. For
CocoaError
, we would now see this: