Bug 18077 – Documentation duplicated when example is inside static if or version

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-12-14T01:37:29Z
Last change time
2024-12-13T18:55:31Z
Assigned to
No Owner
Creator
Jonathan M Davis
Moved to GitHub: dmd#19347 →

Comments

Comment #0 by issues.dlang — 2017-12-14T01:37:29Z
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
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19347 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB