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.
Comment #1 by robert.schadek — 2024-12-13T18:55:31Z