Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Different symbols have the same name and therefore the same anchor #227

Open
Lukas-Stuehrk opened this issue Mar 22, 2021 · 1 comment
Open
Labels
bug Something isn't working

Comments

@Lukas-Stuehrk
Copy link
Member

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:
Screenshot 2021-03-22 at 22 08 32

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.

@Lukas-Stuehrk Lukas-Stuehrk added the bug Something isn't working label Mar 22, 2021
@Tunous
Copy link
Contributor

Tunous commented Mar 23, 2021

The same happens when functions differ only in generics:

public class SomeClass {
    public func onMessage(action: () -> Void) {}

    public func onMessage<T>(action: (T) -> Void) {}
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants