i’m not entirely sure what you mean by documentation syntax as that could refer to a number of things (@_documentation
attribute, swift-flavored markdown comments, swift-flavored markdown directives, DocC aside blocks, Unidoc asides, Jazzy asides etc.) but i imagine you mean something resembling the existing @available(renamed:)
attribute, such as
extension A
{
/// Some shared documentation...
@_documentation(overloads: "f(x:)", "f(x:y:)")
func f(x:Int)
func f(x:Int32)
// For some reason, i, the writer, do not want this
// included in the overload group
func f(x:Int64)
func f(x:Int, y:Int = 0)
}
of course, @available(renamed:)
cannot disambiguate overloads today, so we are back to folded FNV-1 hashes
/// Some shared documentation...
@_documentation(overloads: "f(x:) [XYZ123]", "f(x:y:)")
func f(x:Int)
this does shift the “symbol hash problem” from the references to the referents, but i’m not sure if this would actually reduce the number of hashes users would have to write, since this would essentially be asking users to eagerly deduce and record the hashes even if nothing is referring to that symbol.