annotate run/this_03.d @ 1576:b3e16c86558e

[Issue 1398] New: GDC doesn't generate correct code <mariusmuja@gmail.com> 2007-08-04 http://d.puremagic.com/issues/show_bug.cgi?id=1398
author thomask
date Thu, 21 Feb 2008 15:20:08 +0000
parents 52c9e86b6486
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
224
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
1 // $HeadURL$
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
2 // $Date$
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
3 // $Author$
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
4
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
5 // @author@ Jarrett Billingsley <kb3ctd2@yahoo.com>
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
6 // @date@ 2004-12-30
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
7 // @uri@ news:cr19ka$q75$1@digitaldaemon.com
1383
52c9e86b6486 @url@ -> @uri@
thomask
parents: 805
diff changeset
8 // @uri@ nntp://digitalmars.com/digitalmars.D/14115
224
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
9
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
10 module dstress.run.this_03;
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
11
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
12 class Node{
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
13 static Node[Node] nodes;
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
14
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
15 this(){
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
16 nodes[this]=this;
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
17 }
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
18
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
19 ~this(){
805
94e2e6e8ec70 added DMD-0.145 results
thomask
parents: 569
diff changeset
20 nodes.remove(this);
224
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
21 }
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
22 }
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
23
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
24 int main(){
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
25 assert(Node.nodes.length==0);
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
26 Node n = new Node();
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
27 assert(Node.nodes.length==1);
7d62be503e5f this in class constructor/destructor
thomask
parents:
diff changeset
28 return 0;
805
94e2e6e8ec70 added DMD-0.145 results
thomask
parents: 569
diff changeset
29 }