View mode: basic / threaded / horizontal-split · Log in · Help
February 16, 2010
assert(object) calls invariant and crash
For some reason this creates an access violation:

	Object o;

Apparently it's by design. This expression is calling o's invariant, it 
does not check for null as I'd expect. But o is null so calling 
invariant just crashes.

According to an old bug report, things have been working like this for 
a long time.

It works according to spec:

I wonder how many time I wrote the above assertion thinking I was just 
checking for null...

Michel Fortin
Top | Discussion index | About this forum | D home