| 1 |
// PERMUTE_ARGS: |
| 2 |
// REQUIRED_ARGS: -D -Dd${RESULTS_DIR}/compilable -o- |
| 3 |
// POST_SCRIPT: compilable/extra-files/ddocAny-postscript.sh |
| 4 |
|
| 5 |
// https://issues.dlang.org/show_bug.cgi?id=294 |
| 6 |
|
| 7 |
/// The foo |
| 8 |
struct Foo(T) { } |
| 9 |
/// ditto |
| 10 |
struct Foo(T,U) { } |
| 11 |
|
| 12 |
/** This basic case doesn't work very well. The template signature is |
| 13 |
* documented twice, but the function signature (argument names and return |
| 14 |
* type) is not documented at all. This comment is also repeated twice. */ |
| 15 |
int func1(T)(T x) {} |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
/** This comment is also repeated twice, and the second function signature is |
| 20 |
* not very well documented. */ |
| 21 |
int func2(T,U)(T x, U y) {} |
| 22 |
|
| 23 |
/// ditto |
| 24 |
int func2(T)(T x) {} |
| 25 |
|
| 26 |
/// Separate overload item. |
| 27 |
int func2()() {} |
| 28 |
|
| 29 |
|
| 30 |
/// |
| 31 |
template func3(T,U) { |
| 32 |
/** This used to work adequately and documented both func3 templates |
| 33 |
* simultaneously. Now, it documents the first template twice and |
| 34 |
* no longer documents the function argument and return types.*/ |
| 35 |
int func3(T x, U y) {} |
| 36 |
} |
| 37 |
|
| 38 |
/// ditto |
| 39 |
deprecated template func3(T, U=int, V:long) { |
| 40 |
private int func3(T x) {} |
| 41 |
} |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
/** |
| 46 |
* blah |
| 47 |
*/ |
| 48 |
|
| 49 |
void map(char rs) |
| 50 |
{ |
| 51 |
} |
| 52 |
|
| 53 |
/// Ditto |
| 54 |
void map(int rs) |
| 55 |
{ |
| 56 |
} |
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
/** |
| 61 |
* blah |
| 62 |
*/ |
| 63 |
|
| 64 |
void map2()(char rs) |
| 65 |
{ |
| 66 |
} |
| 67 |
|
| 68 |
/// Ditto |
| 69 |
void map2()(int rs) |
| 70 |
{ |
| 71 |
} |
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
/** |
| 76 |
* blah http://www.map3.com map3 |
| 77 |
*/ |
| 78 |
|
| 79 |
void map3(char rs) |
| 80 |
{ |
| 81 |
} |
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
/** |
| 87 |
* blah http://www.map.com map |
| 88 |
*/ |
| 89 |
|
| 90 |
void map4(string s)(char rs) |
| 91 |
{ |
| 92 |
} |
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
/** |
| 97 |
* blah http://www.map.com map |
| 98 |
*/ |
| 99 |
|
| 100 |
template map5(string s) |
| 101 |
{ |
| 102 |
} |
| 103 |
|
| 104 |
|
| 105 |
/** blah */ |
| 106 |
struct bar6 { |
| 107 |
int blah; |
| 108 |
} |
| 109 |
|
| 110 |
|
| 111 |
/** template bodies */ |
| 112 |
struct Foo7(T) { |
| 113 |
|
| 114 |
/**Attempt one: Doc outside static if.*/ |
| 115 |
static if(is(T == uint)) { |
| 116 |
/**Attempt two: Inside.*/ |
| 117 |
void bar() {} |
| 118 |
} |
| 119 |
else { |
| 120 |
/**Attempt two: else.*/ |
| 121 |
void bar() {} |
| 122 |
} |
| 123 |
|
| 124 |
/** the abc function should be static */ |
| 125 |
static void abc() { } |
| 126 |
} |
| 127 |
|
| 128 |
|
| 129 |
/** show abstract */ |
| 130 |
abstract class Foo8 { } |
| 131 |
|
| 132 |
/// a stray $(RPAREN) mustn't foul the macros |
| 133 |
void bug4878(string a = ")") {} |
| 134 |
|
| 135 |
/**** |
| 136 |
*/ |
| 137 |
struct S |
| 138 |
{ |
| 139 |
/**** |
| 140 |
*/ |
| 141 |
this(long ticks) const pure nothrow { } |
| 142 |
|
| 143 |
/**** |
| 144 |
*/ |
| 145 |
pure nothrow this(this) { } |
| 146 |
|
| 147 |
/**** |
| 148 |
*/ |
| 149 |
const pure nothrow ~this() { } |
| 150 |
|
| 151 |
/**** |
| 152 |
*/ |
| 153 |
void foo(long ticks) const pure nothrow { } |
| 154 |
} |
| 155 |
|
| 156 |
|
| 157 |
/** Produces something in (a;b] */ |
| 158 |
float f10(float a, float b) { return (a+b)/2.0; } |
| 159 |
/** Produces something in [a;b) */ |
| 160 |
float h10(float a, float b) { return (a+b)/2.0; } |
| 161 |
|
| 162 |
|
| 163 |
/// |
| 164 |
void bug6090(string f="$(B b)", char g=')')(string h="$(", string i="$)") {} |
| 165 |
|
| 166 |
|
| 167 |
/**** |
| 168 |
*/ |
| 169 |
struct T |
| 170 |
{ |
| 171 |
/**** |
| 172 |
*/ |
| 173 |
this(A...)(A args) { } |
| 174 |
|
| 175 |
/// |
| 176 |
this(int){} |
| 177 |
} |
| 178 |
|
| 179 |
|
| 180 |
// https://issues.dlang.org/show_bug.cgi?id=14547 |
| 181 |
|
| 182 |
/// doc-comment |
| 183 |
int x14547 = 1; |
| 184 |
|
| 185 |
/// ditto |
| 186 |
enum int y14547 = 2; |
| 187 |
|
| 188 |
/// doc-comment |
| 189 |
enum isInt14547(T) = is(T == int); |
| 190 |
|
| 191 |
/// ditto |
| 192 |
enum bool isString14547(T) = is(T == string); |
| 193 |
|
| 194 |
/// ditto |
| 195 |
static immutable typeName14547(T) = T.stringof; |
| 196 |
|
| 197 |
/// ditto |
| 198 |
int storageFor14547(T) = 0; |
| 199 |
|
| 200 |
/// doc-comment |
| 201 |
template foo14547(T) |
| 202 |
{ |
| 203 |
enum int foo14547 = T.stringof.length; |
| 204 |
} |
| 205 |
|
| 206 |
/// ditto |
| 207 |
template bar14547(T) if (is(T == int)) |
| 208 |
{ |
| 209 |
enum int bar14547 = T.stringof.length; |
| 210 |
} |