#include #include #include #include #include #include struct Server { inline actor; }; struct Server2 { inline Server; int b; }; void ^?{}( Server2 & this ) { mutex(sout) sout | 'A'; } struct D_msg { int a; inline message; }; void ?{}( D_msg & this ) { set_allocation( this, Delete ); } void ^?{}( D_msg & ) { mutex(sout) sout | 'A'; } struct D_msg2 { inline D_msg; }; allocation handle() { return Finished; } allocation receive( Server & receiver, D_msg & msg ) { return handle(); } allocation receive( Server & receiver, D_msg2 & msg ) { return handle(); } allocation receive( Server2 & receiver, D_msg & msg ) { return Delete; } allocation receive( Server2 & receiver, D_msg2 & msg ) { return Delete; } int main() { sout | "Start"; { actor_start(); D_msg * dm = alloc(); (*dm){}; D_msg2 * dm2 = alloc(); (*dm2){}; Server2 * s = alloc(); (*s){}; Server2 * s2 = alloc(); (*s2){}; *s | *dm; *s2 | *dm2; actor_stop(); } { actor_start(); Server s[2]; D_msg * dm = alloc(); (*dm){}; D_msg2 * dm2 = alloc(); (*dm2){}; s[0] | *dm; s[1] | *dm2; actor_stop(); } sout | "Finished"; }