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

Character substitution in file names can lead to collisions #285

Open
Lukas-Stuehrk opened this issue May 20, 2021 · 1 comment
Open

Character substitution in file names can lead to collisions #285

Lukas-Stuehrk opened this issue May 20, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@Lukas-Stuehrk
Copy link
Member

When generating file names for symbols, swift-doc replaces some characters of the symbol's name with underscore (_).

This can lead to the problem that it produces the same file name for different symbols with different names. The second symbol then overwrites the page of the previously declared symbol.

This happens rather often with operators:

infix operator >>>
public func >>> (lhs: String, rhs: String) { }

infix operator <<<
public func <<< (lhs: String, rhs: String) { }

Both create the file ___.

But it can also happen for any other symbol:

public class Outer {
    public struct Inner {}
}

public class Outer_Inner {}

Both symbols create the file Outer_Inner.

@Lukas-Stuehrk Lukas-Stuehrk added the bug Something isn't working label May 20, 2021
@Lukas-Stuehrk Lukas-Stuehrk changed the title Character substituion in file names can lead to collisions Character substitution in file names can lead to collisions May 20, 2021
@mattt
Copy link
Contributor

mattt commented Jun 1, 2021

Related to #258

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