[5.7] consider requirements of an underscored protocol to also be underscored #59487
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.
Explanation: SymbolGraphGen considered symbols whose names begin with an underscore to be
internal
orprivate
, based on their actual access level. While this extends to direct children of the symbol (properties, methods, enum cases, etc), property requirements can slip through when the property conformance is defined in an extension. This PR updates the filtering logic to consider requirements of a protocol with an underscored name to have underscored names themselves.Scope: Affects symbol graph generation when the "minimum access level" is set to
public
(the default).Bug: rdar://94336558
Risk: Low. The changes are restricted to SymbolGraphGen, and should not affect normal compilation. The symbols that are filtered out because of this change can be viewed in a symbol graph by setting the minimum access level to
internal
orprivate
.Testing: The lit test
SymbolGraph/Symbols/SkipsPublicUnderscore.swift
has been updated to verify this behavior. Existing automated tests still pass.