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