DbC bug?

Magnus Lie Hetland magnus at hetland.org
Mon Feb 27 00:31:14 PST 2012


On 2012-02-23 15:59:18 +0000, H. S. Teoh said:

> Looks like a compiler bug. You should never be able to access invalid
> values.

Indeed. After spending quite a while whittling down my code, I've 
posted the following snippet as issue #7599:

module main;
import std.conv;

class Class {

    void method(uint arg)
    in {
        // assert(arg + 1); // Uncomment to prevent bug
    }
    out {
        assert(arg == 0, "BUG: arg == " ~ to!string(arg));
    }
    body {}

}

void main(string[] args) {
    (new Class).method(0);
}

-- 
Magnus Lie Hetland
http://hetland.org



More information about the Digitalmars-d-learn mailing list