Mercurial > projects > ldc
annotate tests/mini/classes9.d @ 1442:0a5f7890f327
Adjust some more code that was depending on the function and delegate calling
conventions being equal.
There's also an instance in `tango.text.convert.Layout` that should be adjusted:
{{{
Index: tango/text/convert/Layout.d
===================================================================
--- tango/text/convert/Layout.d (revision 4578)
+++ tango/text/convert/Layout.d (working copy)
-660,8 +660,12 @@
case TypeCode.STRUCT:
auto s = cast(TypeInfo_Struct) type;
- if (s.xtoString)
- return Utf.fromString8 (s.xtoString(p), result);
+ if (s.xtoString) {
+ char[] delegate() toString;
+ toString.ptr = p;
+ toString.funcptr = cast(char[] function()) s.xtoString;
+ return Utf.fromString8 (toString(), result);
+ }
goto default;
case TypeCode.INTERFACE:
}}}
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Sun, 31 May 2009 15:27:01 +0200 |
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 } |