[Issue 18077] New: Documentation duplicated when example is inside static if or version

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Dec 14 01:37:29 UTC 2017


https://issues.dlang.org/show_bug.cgi?id=18077

          Issue ID: 18077
           Summary: Documentation duplicated when example is inside static
                    if or version
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: issues.dlang at jmdavisProg.com

With either of these code samples

========
struct S(R)
{
    /// Something to say
    static if(is(R == string))
    {
        alias S = R;

        ///
        unittest
        {
            S s;
        }
    }
    else
        alias S = int;
========
///
struct S(R)
{
    /// Something to say
    version(Posix)
    {
        alias S = R;

        ///
        unittest
        {
            S s;
        }
    }
    else
        alias S = int;
}
========

the documentation comment on the alias gets duplicated immediately after
"Examples:" and before the code examples. So, you get

========
Something to say

Examples
Something to say
S s;
========

(though obviously, the second example would have to be compiled on a POSIX
system or have the version identifier changed in order to work).

I tried this as a way to work around
https://issues.dlang.org/show_bug.cgi?id=11133, and clearly, this doesn't work
as a workaround.

--


More information about the Digitalmars-d-bugs mailing list