On Tuesday, 25 March 2014 at 20:49:57 UTC, bearophile wrote:
Note how the opApply() of Foo should not end with a return, while the opApply() of Bar is required by the D compiler to end with a return.

Yet, Foo is contains an infinite loop, so the result of Bar will not be reached. But the type system of D is not strong enough to see that.

I'm not seeing it. "while (true)" is no more an infinite loop than "for (i = 0; i < x; i++)", if the body of the while has a break or return statement.

int i = 0;
while (true) {
    if (i < x) break;
    i++;
}

Reply via email to