On 07/07/2017 10:52 AM, Ali Çehreli wrote:
> a solution with the addition of the
> keyword 'delegate':

As ag0aep6g explained, the 'delegate' keyword was not necessary there. A case where it's needed is when defining a variable. The following code compiles if 'delegate' keyword is present:

void foo(int delegate (int)) {
}

void main() {
    // 'delegate' keyword needed to compile:
    auto f = delegate (int i) => i * 2;
    foo(f);
}

Ali

Reply via email to