Am 08.01.2013 12:14, schrieb bearophile:
How do you add contracts to delegates?

This doesn't work:


void main() {
     void delegate(int) foo;

     foo = (x)
     in {
         assert(x > 0);
     } body {
     };
}


Nor this:


void main() {
     void delegate(int) foo
     in {
         assert(x > 0);
     };

     foo = (x) {};
}

Bye,
bearophile

I don't think that this is possible at all. Do you think this is usefull?

Kind Regards
Benjamin Thaut

Reply via email to