annotate run/bug_e2ir_141_B.d @ 435:ec6d35cccfb5

pre dmd-0.121 review Walter <walter@digitalmars.com> 2005-04-15 mail:000e01c54203$22c0e850$0200a8c0@colossus
author thomask
date Sat, 16 Apr 2005 08:18:57 +0000
parents 17b5647d8463
children 52c9e86b6486
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
216
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
1 // $HeadURL$
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
2 // $Date$
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
3 // $Author$
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
4
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
5 // @author@ Vathix <vathix@dprogramming.com>
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
6 // @date@ 2004-12-29
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
7 // @uri@ news:opsjr1fu1jkcck4r@tc3-ppp187.dialup.wzrd.com
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
8 // @url@ nntp://digitalmars.com/digitalmars.D.bugs/2620
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
9
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
10 module dstress.run.bug_e2ir_141_B;
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
11
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
12 class MyClass{
435
ec6d35cccfb5 pre dmd-0.121 review
thomask
parents: 216
diff changeset
13 static int _i;
ec6d35cccfb5 pre dmd-0.121 review
thomask
parents: 216
diff changeset
14
216
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
15 static int prop(){
435
ec6d35cccfb5 pre dmd-0.121 review
thomask
parents: 216
diff changeset
16 return _i;
216
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
17 }
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
18
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
19 static void prop(int i){
435
ec6d35cccfb5 pre dmd-0.121 review
thomask
parents: 216
diff changeset
20 _i=i;
216
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
21 }
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
22 }
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
23
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
24 int main(){
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
25 MyClass c = new MyClass();
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
26 c.prop = true ? MyClass.prop : MyClass.prop;
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
27 assert(c.prop == 0);
435
ec6d35cccfb5 pre dmd-0.121 review
thomask
parents: 216
diff changeset
28 c.prop = 7;
216
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
29 assert(c.prop == 7);
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
30 return 0;
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
31 }