www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9728] New: Ddoc anchors non-unique across overloads


           Summary: Ddoc anchors non-unique across overloads
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: hsteoh quickfur.ath.cx

--- Comment #0 from hsteoh quickfur.ath.cx 2013-03-15 09:54:15 PDT ---
If there are overloaded functions, the same anchor ID is generated for all
overloads, making it impossible to link to a specific one.

Example code:

/// First overload
void func() { }

/// Second overload
void func(int x) { }

/// Main
void main() {}

Ddoc output:

        <META http-equiv="content-type" content="text/html; charset=utf-8">
        <!-- Generated by Ddoc from test.d -->
<dl><dt><big><a name="func"></a>void <u>func</u>();
<dd>First overload<br><br>

<dt><big><a name="func"></a>void <u>func</u>(int <i>x</i>);
<dd>Second overload<br><br>

<dt><big><a name="main"></a>void <u>main</u>();


        <hr><small>Page generated by <a
href="http://dlang.org/ddoc.html">Ddoc</a>. </small>


Note that overriding the default Ddoc macros does not help, because DDOC_ANCHOR
is only passed the function name, so there is no way to distinguish between

Not to mention, this breaks HTML compliance (anchor names are supposed to be

Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 15 2013