Mercurial > projects > ldc
comparison tangotests/classes1.d @ 169:2df270e1ba59 trunk
[svn r185] Fixed broken nested classes with data members, did DMD change the class layout? tango.text.Regex now compiles.
Commented some of the *very* verbose logging for -vv option.
author | lindquist |
---|---|
date | Tue, 06 May 2008 03:07:21 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
168:08cfde5f70d3 | 169:2df270e1ba59 |
---|---|
1 module tangotests.classes1; | |
2 | |
3 class Outer | |
4 { | |
5 int data; | |
6 | |
7 class Inner | |
8 { | |
9 long data; | |
10 | |
11 this(long d) | |
12 { | |
13 data = d*2; | |
14 } | |
15 } | |
16 | |
17 void func() | |
18 { | |
19 auto i = new Inner(data); | |
20 data += (i.data/4); | |
21 } | |
22 | |
23 this(int d) | |
24 { | |
25 data = d; | |
26 } | |
27 } | |
28 | |
29 void main() | |
30 { | |
31 scope c = new Outer(100); | |
32 c.func(); | |
33 int d = c.data; | |
34 printf("150 = %d\n", d); | |
35 } | |
36 | |
37 extern(C) int printf(char*, ...); |