Mercurial > projects > ldc
annotate test/classes4.d @ 94:61615fa85940 trunk
[svn r98] Added support for std.c.stdlib.alloca via pragma(LLVM_internal, "alloca").
Added support for array .sort and .reverse properties.
Fixed some bugs with pointer arithmetic.
Disabled some DMD AST optimizations that was messing things up, destroying valuable information.
Added a KDevelop project file, this is what I use for coding LLVMDC now :)
Other minor stuff.
author | lindquist |
---|---|
date | Mon, 12 Nov 2007 06:32:46 +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 } |