annotate tests/mini/nested13.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 a34078905d01
children 27948fd2e7ef
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
486
a34078905d01 Added pragma(llvmdc, "string") for misc per-module compiler configuration, currently "string" can only be "verbose" which forces -vv for module it appears in.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 341
diff changeset
1 module mini.nested13;
259
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
2
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
3 extern(C) int printf(char*, ...);
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
4
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
5 void main()
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
6 {
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
7 int var = 2;
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
8
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
9 void exec(void delegate() dg)
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
10 {
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
11 printf("var = %d\n", var);
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
12 dg();
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
13 }
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
14
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
15 void foo()
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
16 {
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
17 printf("var = %d\n", var);
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
18 assert(var == 5);
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
19 }
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
20
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
21 void bar()
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
22 {
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
23 printf("var = %d\n", var);
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
24 var += 3;
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
25 exec(&foo);
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
26 }
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
27
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
28 printf("var = %d\n", var);
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
29 exec(&bar);
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
30
2e652b8ad1fd [svn r277] Fixed a nasty bug in delegate expressions. Context pointers to nested functions of the parent, from inside a nested function were
lindquist
parents:
diff changeset
31 return 0;
262
88252a1af660 [svn r280] Fixed a bunch of issues with switch statements. Ended up a bit far reaching...
lindquist
parents: 259
diff changeset
32 }