Mercurial > projects > ldc
annotate test/classes4.d @ 203:e881c9b1c738 trunk
[svn r219] Fixed: the tango/lib/gc/basic garbage collector now compiles and links into an executable (change in tango/lib/llvmdc-posix.mak), closes #5 .
Changed: removed the crappy realloc based dynamic memory runtime and started moving over to DMD style runtime support, part of moving to real GC.
Fixed: dynamic arrays now use GC runtime for allocating memory.
Fixed: new expression now use GC for allocating memory.
Changed: revamped the dynamic array support routines related to dynamic memory.
Fixed: assertions no longer create exsessive allocas.
Changed: misc. minor cleanups.
author | lindquist |
---|---|
date | Tue, 13 May 2008 14:42:09 +0200 |
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 } |