Mercurial > projects > ldc
annotate test/classes4.d @ 131:5825d48b27d1 trunk
[svn r135] * Merged DMD 1.025 *
* Fixed a minor linking order mishap *
* Added an command line option -annotate *
* Fixed some problems with running optimizations *
* Added std.stdio and dependencies to lphobos (still not 100% working, but compiles and links) *
* Fixed problems with passing aggregate types to variadic functions *
* Added initial code towards full GC support, currently based on malloc and friends, not all the runtime calls the GC yet for memory *
* Fixed problems with resolving nested function context pointers for some heavily nested cases *
* Redid function argument passing + other minor code cleanups, still lots to do on this end... *
author | lindquist |
---|---|
date | Fri, 04 Jan 2008 01:38:42 +0100 |
parents | c53b6e3fe49a |
children | d9d5d59873d8 |
rev | line source |
---|---|
1 | 1 class A |
2 { | |
3 int i = 42; | |
4 double df = 3.1415; | |
5 this() | |
6 { | |
7 } | |
8 char[] toString() | |
9 { | |
10 return "A:Object"; | |
11 } | |
12 } | |
13 | |
14 class B : A | |
15 { | |
16 ubyte b; | |
17 char[] toString() | |
18 { | |
19 return "B:A"; | |
20 } | |
21 } | |
22 | |
23 void main() | |
24 { | |
25 scope a = new A; | |
26 char[] as = a.toString; | |
27 {printf("a.toString = '%.*s'\n", as.length, as.ptr);} | |
28 | |
29 Object o = a; | |
30 char[] os = o.toString; | |
31 {printf("o.toString = '%.*s'\n", os.length, os.ptr);} | |
32 | |
33 scope b = new B; | |
34 char[] bs = b.toString; | |
35 {printf("b.toString = '%.*s'\n", bs.length, bs.ptr);} | |
36 } |