Mercurial > projects > ldc
annotate tangotests/b.d @ 167:adca7f32fb6d trunk
[svn r183] Fixed broken identity expressions with two pointers of different types.
Fixed broken pointer arithmetic for subtraction (tango.text.Util unittest now passes)
author | lindquist |
---|---|
date | Tue, 06 May 2008 01:23:02 +0200 |
parents | 1700239cab2e |
children | 68a7dd38c03c |
rev | line source |
---|---|
132 | 1 class C |
2 { | |
3 int a; | |
4 union | |
5 { | |
6 int i; | |
7 double d; | |
8 } | |
9 int z; | |
10 } | |
11 | |
12 void func() | |
13 { | |
14 scope c = new C; | |
15 access1(c); | |
16 assert(c.i == 42); | |
17 access2(c); | |
18 assert(c.d == 2.5); | |
19 } | |
20 | |
21 void access1(C c) | |
22 { | |
23 c.i = 42; | |
24 } | |
25 | |
26 void access2(C c) | |
27 { | |
28 c.d = 2.5; | |
29 } |