Skip to content

Disfavor default implementations and synthesized symbols in link collisions #540

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

Conversation

d-ronnqvist
Copy link
Contributor

Bug/issue #, if applicable: rdar://98781530

Summary

This adds basic handling of collisions to deprioritize synthesized symbols and default implementations of protocol requirements.

It's more likely that the developer intended to link to the other symbol so the hierarchy based resolver will resolve the ambiguous link the to that symbol.

Dependencies

None.

Testing

  • Create a public protocol with some protocol requirements and also add a public default implementation of it.
  • Write a symbol link to without disambiguation to the protocol requirement. For example:
/// These two links should resolve:
///
/// - ``Something/doSomething()``
/// - ``doSomething()``
public protocol Something {
    func doSomething()
}
public extension Something {
    func doSomething() {}
}

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran the ./bin/test script and it succeeded
  • Updated documentation if necessary

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@QuietMisdreavus QuietMisdreavus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@d-ronnqvist d-ronnqvist merged commit c74237d into swiftlang:main Apr 11, 2023
@d-ronnqvist d-ronnqvist deleted the disfavor-default-impl-in-link-collision branch April 11, 2023 00:28
d-ronnqvist added a commit to d-ronnqvist/swift-docc that referenced this pull request Apr 11, 2023
…isions (swiftlang#540)

* Disfavor default implementations and synthesized symbols in link collisions

rdar://98781530

* Add link to SymbolKit enhancement request about synthesized symbols
d-ronnqvist added a commit that referenced this pull request Apr 12, 2023
…isions (#540) (#544)

* Disfavor default implementations and synthesized symbols in link collisions

rdar://98781530

* Add link to SymbolKit enhancement request about synthesized symbols
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