swift-doc icon indicating copy to clipboard operation
swift-doc copied to clipboard

Character substitution in file names can lead to collisions

Open Lukas-Stuehrk opened this issue 4 years ago • 1 comments

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 avatar May 20 '21 07:05 Lukas-Stuehrk

Related to #258

mattt avatar Jun 01 '21 17:06 mattt