Mercurial > projects > dstress
annotate run/d/delegate_19_A.d @ 1320:daef239f37cf
sed'ed replacement of new:...http.d.puremagic.com/issues/ with http://d.puremagic.com/issues/show_bug.cgi?...
author | thomask |
---|---|
date | Sun, 31 Dec 2006 19:59:08 +0000 |
parents | 48fc88ca588a |
children |
rev | line source |
---|---|
1123 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 // @author@ <someidiot@earthlink.net> | |
6 // @date@ 2006-08-23 | |
1320
daef239f37cf
sed'ed replacement of new:...http.d.puremagic.com/issues/ with http://d.puremagic.com/issues/show_bug.cgi?...
thomask
parents:
1123
diff
changeset
|
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=306 |
1123 | 8 // @desc@ [Issue 306] New: dmd 165 breaks existing code |
9 | |
10 module dstress.run.d.delegate_19_A; | |
11 | |
12 int status; | |
13 | |
14 void append (char[] content){ | |
15 status++; | |
16 } | |
17 | |
18 void append (char[] delegate() dg){ | |
19 status--; | |
20 } | |
21 | |
22 int main(){ | |
23 char[] s = "abc"; | |
24 | |
25 char[] dummy(){ | |
26 return "123"; | |
27 } | |
28 | |
29 append(s); | |
30 if(status != 1){ | |
31 assert(0); | |
32 } | |
33 | |
34 append(dummy); | |
35 if(status != 2){ | |
36 assert(0); | |
37 } | |
38 | |
39 append(&dummy); | |
40 if(status != 1){ | |
41 assert(0); | |
42 } | |
43 | |
44 append(dummy()); | |
45 if(status != 2){ | |
46 assert(0); | |
47 } | |
48 | |
49 return 0; | |
50 } |