swift-doc
swift-doc copied to clipboard
Different symbols have the same name and therefore the same anchor
It's possible to have functions, methods, operators etc. with the same names, but different types. One example would be the following class declaration:
public class SomeClass {
public func someMethod(arg: String) {
}
public func someMethod(arg: Int) {
}
}
This creates symbols with exactly the same name in the documentation:

And for both methods we then create the same anchor #someclass.somemethod(arg:), therefore creating invalid HTML and making it impossible to directly link to the second method.
The same happens when functions differ only in generics:
public class SomeClass {
public func onMessage(action: () -> Void) {}
public func onMessage<T>(action: (T) -> Void) {}
}