Skip to content

Conversation

@QuietMisdreavus
Copy link
Contributor

Cherry-pick of #257

Explanation: Symbols from ellipsis-style operators (e.g. the ... operator from Equatable) are currently improperly sorted into an unnamed "Implementations" page. This PR enhances the default implementations curation by attempting to look up a symbol's sourceOrigin information, or discarding empty-string components in the symbol name if it fails to look up.

Scope: Affects rendering documentation for Swift symbols with Equatable conformances. The fix should allow affected symbols both in the same module and from other modules to get correct default-implementation pages.

Radar: rdar://93203894

Risk: Low. The curation of "default implementations" sections will fall back to organizing the symbols directly into the parent's page if the lookup fails entirely, so no information is lost.

Testing: A test has been added to ensure that ellipsis operator symbols are properly curated into their appropriate protocol's page. Existing automated tests still pass.

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test

rdar://93203894

Symbols for operator functions that include multiple dots (e.g. the
ClosedRange `...` operator) are currently curated into an unnamed
"Implementations" section due to improper string splitting behavior.
This enhances the detection two ways:

1. For symbols where the "source origin" is available in our given
   symbol graphs, it loads the name information from the parent symbol.
2. For symbols where the "source origin" is not available, it improved
   the string splitting behavior by dropping empty-string components
   before reading names from it.

This allows Comparable and Equatable implementations to curate their
inherited operators properly.
@QuietMisdreavus
Copy link
Contributor Author

Rebased.

@swift-ci Please test

@QuietMisdreavus QuietMisdreavus merged commit 46d9994 into swiftlang:release/5.7 Jun 14, 2022
@QuietMisdreavus QuietMisdreavus deleted the 5.7/origin-split branch June 14, 2022 16:45
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.

2 participants