Mercurial > projects > dstress
diff nocompile/delegate_11.d @ 155:2c9eb7937bb2
added delegate tests
author | thomask |
---|---|
date | Wed, 01 Dec 2004 07:23:29 +0000 |
parents | |
children | 1f6cf5ccfbc9 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nocompile/delegate_11.d Wed Dec 01 07:23:29 2004 +0000 @@ -0,0 +1,23 @@ +// $HeaderURL$ +// $Date$ +// $Author$ + +// delegates can only be initialized with non-static member functions + +module dstress.nocompile.delegate_11; + +union MyUnion{ + static int test(){ + return b; + } + byte b; +} + +int main(){ + int delegate() dl; + + MyUnion u; + dl = &u.test; + + return 0; +}