Skip to content

Don't omit "Type" suffix from disambiguation for Swift metatypes #1230

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

Conversation

d-ronnqvist
Copy link
Contributor

@d-ronnqvist d-ronnqvist commented Jun 3, 2025

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

Summary

This makes a small bug fix to type signature disambiguation for parameters or return values that are Swift metatypes (Something.Type).

Dependencies

None.

Testing

  • Define some overloads where one of the parameters or return values necessary for disambiguation is a metatype. For example:

    public func doSomething(with value: Int) {}
    public func doSomething(with type: BinaryInteger.Type) {}
    
  • Write an ambiguous link to these overloads:

    /// ``doSomething(with:)``
    public enum Something {}
    
  • The suggestions for what disambiguation to add to should use BinaryInteger.Type instead of just BinaryInteger. (with the trailing .)

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

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@patshaughnessy patshaughnessy 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 👍 I was able to reproduce the disambiguation problem using main and then verify it worked as expected using this fix.

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

@d-ronnqvist d-ronnqvist merged commit b76e07f into swiftlang:main Jun 17, 2025
2 checks passed
d-ronnqvist added a commit to d-ronnqvist/swift-docc that referenced this pull request Jun 17, 2025
…ftlang#1230)

* Don't omit "Type" suffix from disambiguation for Swift metatype parameters

rdar://152496046

* Remove trailing commas for compatibility before Swift 6.1
@d-ronnqvist d-ronnqvist deleted the fix-metatype-suffix-in-type-disambiguation branch June 17, 2025 09:39
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