On Mon, 11 Oct 2010 03:53:07 +0400, Christopher Bergqvist <[email protected]> wrote:

Thanks for the support guys. :)

Unfortunately "halt" would still need to be a keyword if one wants to keep the full behavior of assert(0), where the compiler knows that it affects the
control-flow of the program.

Legal:
int main()
{
    assert(0);
}

Illegal (Error: function D main has no return statement, but is expected to
return a value of type int):
int main()
{
    int a = 0;
    assert(a);
}



Just a random thought:

class Foo
{
    this(int i) { ... }
}

class Bar
{
    this(int j) { assert(false); }
}

Still illegal, but that's a bug I guess.

Reply via email to