Mercurial > projects > dstress
annotate run/destructor_01.d @ 1630:d0efa3ae5522 default tip
run/mini/naked_asm5: New x86_64 ABI passes the arguments in reverse order.
author | David Nadlinger <code@klickverbot.at> |
---|---|
date | Sat, 23 Apr 2011 22:57:32 +0200 |
parents | 7b7967dd4203 |
children |
rev | line source |
---|---|
140 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
0 | 4 |
5 // @author@ David Friedman <d3rdclsmail@earthlink.net> | |
6 // @date@ 2004-05-01 | |
1489 | 7 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=51 |
0 | 8 |
374 | 9 module dstress.run.destructor_01; |
10 | |
0 | 11 int status; |
12 | |
13 class ClassA{ | |
14 this(){ | |
15 status++; | |
16 assert(status==1); | |
17 } | |
18 | |
19 ~this(){ | |
20 status--; | |
21 assert(status==0); | |
22 } | |
23 } | |
24 | |
25 class ClassB : ClassA {} | |
26 | |
27 void test(){ | |
1616
7b7967dd4203
More auto -> scope changes.
Christian Kamm <kamm incasoftware de>
parents:
1489
diff
changeset
|
28 scope ClassB b = new ClassB(); |
0 | 29 |
30 } | |
31 | |
32 int main(){ | |
33 test(); | |
34 return 0; | |
35 } |