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

Reply via email to