mirror of
https://github.com/tayloraswift/swift-unidoc.git
synced 2026-04-03 00:09:10 -06:00
Type signature disambiguations do not take into account same-type generic constraints when substituting Self #38
Labels
No labels
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
documentation
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
snippets
snippets
symbol graphs
symbol graphs
symbol graphs
ui
ui
ui
voting
voting
vulnerability
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github/swift-unidoc#38
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tayloraswift on 1/2/2025
this is a hole that is originally caused by the Swift compiler bug https://github.com/swiftlang/swift/issues/78343 , but is not sufficiently patched by Unidoc’s downstream heuristics.
specifically, given two extensions like these
the Swift compiler will fail to resolve the
Selftokens, and Unidoc’s heuristic steps in, replacingSelfwithS<T>. however, this substitution has no disambiguative value, as it is identical between both extensions.the client workaround is to avoid
Selfand spell these extensions using the actual resolved types:this would allow documentation to disambiguate between the two overloads with
in theory, Unidoc could inspect the generic constraints and substitute the type arguments itself. but at this point, we are layering heuristics upon heuristics in order to compensate for what is really a plain old Swift compiler bug.