Mercurial > projects > ldc
annotate tests/mini/classes9.d @ 811:8e6135be6999
Fixed ModuleInfo generation to no longer use the ModuleInfo class' default initializer for types/defaults, it's unsafe as initializers don't necesarily match the "formal" type. There might be explicit padding.
Changed -g switch to emit DW_LANG_D debug info, make demangling work with a patched GDB, still more work to do for full support of D's Dwarf extensions.
Added getNullValue helper method.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Mon, 01 Dec 2008 02:10:16 +0100 |
parents | 1bb99290e03a |
children |
rev | line source |
---|---|
114 | 1 module classes9; |
2 | |
3 class C | |
4 { | |
5 } | |
6 | |
7 class D : C | |
8 { | |
9 } | |
10 | |
11 class E | |
12 { | |
13 } | |
14 | |
15 class F : E | |
16 { | |
17 } | |
18 | |
19 void main() | |
20 { | |
21 { | |
22 D d = new D; | |
23 { | |
24 C c = d; | |
25 assert(c !is null); | |
26 D d2 = cast(D)c; | |
27 assert(d2 !is null); | |
28 E e = cast(E)d; | |
29 assert(e is null); | |
30 F f = cast(F)d; | |
31 assert(f is null); | |
32 } | |
33 } | |
34 { | |
35 F f = new F; | |
36 { | |
37 E e = f; | |
38 assert(e !is null); | |
39 F f2 = cast(F)e; | |
40 assert(f2 !is null); | |
41 C c = cast(C)f; | |
42 assert(c is null); | |
43 D d2 = cast(D)f; | |
44 assert(d2 is null); | |
45 } | |
46 } | |
47 } |