Mercurial > projects > ldc
annotate test/classes4.d @ 58:2c3cd3596187 trunk
[svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
Added initial support for CatExp aka 'a ~ b'
Fixed global constant static arrays initialized with string literals
Fixed casting any dynamic array to void*
Fixed new expression with temporary storage
Fixed alias declarations in function scope
Fixed relational comparisons of pointers
author | lindquist |
---|---|
date | Thu, 25 Oct 2007 09:02:55 +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 } |