annotate run/bug_e2ir_141_D.d @ 1597:8b9d4d2f925a

Fix typos in complex tests. See D bug 614.
author Christian Kamm <kamm incasoftware de>
date Tue, 09 Sep 2008 16:53:58 +0200
parents 6e4063f99377
children
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
1487
6e4063f99377 changed nntp: URLs to http: URLs
thomask
parents: 1383
diff changeset
8 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=2620
216
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_D;
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
11
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
12 union MyUnion{
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
13 int a;
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
14 int b;
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
15 }
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
16
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
17 class MyClass{
486
73ac7d1627e0 new(...)
thomask
parents: 435
diff changeset
18 static MyUnion dummy;
73ac7d1627e0 new(...)
thomask
parents: 435
diff changeset
19
487
15d9857b07bd changed value to reference property
thomask
parents: 486
diff changeset
20 static MyUnion* prop(){
15d9857b07bd changed value to reference property
thomask
parents: 486
diff changeset
21 return &dummy;
216
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
22 }
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
23
487
15d9857b07bd changed value to reference property
thomask
parents: 486
diff changeset
24 static void prop(MyUnion* u){
15d9857b07bd changed value to reference property
thomask
parents: 486
diff changeset
25 dummy=*u;
216
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
26 }
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
27 }
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
28
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
29 int main(){
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
30 MyClass c = new MyClass();
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
31 c.prop = true ? MyClass.prop : MyClass.prop;
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
32 assert(c.prop.a == 0);
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
33 c.prop.a = 1;
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
34 assert(c.prop.b == 1);
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
35 return 0;
17b5647d8463 structs/unions and setters/getters
thomask
parents:
diff changeset
36 }