Skip to content
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

Fix symbol link parsing bug for -(_:_:) operators with hash disambiguation #739

Merged

Conversation

d-ronnqvist
Copy link
Contributor

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

Summary

Fix a bug where path component names wasn't consistently parsed depending on if the path component had a hash disambiguation or not. This resulted in subtraction operators (-(_:_:)) parsing as an empty name when the link had a hash disambiguation.

Dependencies

None

Testing

  • Define a public type with -(_:_:) operators, for example:

    public struct MyNumber {
        public static func - (lhs: MyNumber, rhs: MyNumber) -> MyNumber { fatalError("This only needs to compile for a unit test") }
    }
  • Link to MyNumber/-(_:_:)-abc123. After correcting the hash (which depends on the module name where this symbol is defined) link should resolve successfully.

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 d-ronnqvist changed the title Fix symbol link parsing bug for disambiguated subtraction operators Fix symbol link parsing bug for /(_:_:) operators with hash disambiguation Oct 14, 2023
@d-ronnqvist d-ronnqvist changed the title Fix symbol link parsing bug for /(_:_:) operators with hash disambiguation Fix symbol link parsing bug for -(_:_:) operators with hash disambiguation Oct 14, 2023
@patshaughnessy
Copy link
Contributor

@swift-ci please test

@d-ronnqvist d-ronnqvist merged commit c7dad6b into swiftlang:main Nov 8, 2023
2 checks passed
@d-ronnqvist d-ronnqvist deleted the minus-operator-disambiguation-parsing branch November 8, 2023 09:14
d-ronnqvist added a commit to d-ronnqvist/swift-docc that referenced this pull request Nov 10, 2023
…wiftlang#739)

rdar://113870038

Co-authored-by: Pat Shaughnessy <pat_shaughnessy@apple.com>
d-ronnqvist added a commit that referenced this pull request Nov 14, 2023
…739) (#750)

rdar://113870038

Co-authored-by: Pat Shaughnessy <pat_shaughnessy@apple.com>
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