Issue 796 - Asserting a null object reference throws AssertError Failure internal\invariant.d(14) or Access Violation #358

Merged
merged 1 commit into from Jan 11, 2012

3 participants

@yebblies
D Programming Language member

Rewrite assert calls of pointers to structs with invariants and classss references to:
assert(e); -> auto tmp = e, e || assert, e->invariant()

Most of the lines changed are indentation changes due to making some code inside an if {} unconditional.

Add ?w=1 to the url to view the diff without whitespace changes.

http://d.puremagic.com/issues/show_bug.cgi?id=796

@yebblies yebblies Issue 796 - Asserting a null object reference throws AssertError Fail…
…ure internal\invariant.d(14) or Access Violation

Rewrite assert calls of pointers to structs with invariants and classss references to:
`assert(e);` -> `auto tmp = e, e || assert, e->invariant()`
95d6692
@alexrp
D Programming Language member

PLEASE PLEASE PLEASE merge this. The way assert(obj) works right now is seriously an atrocity and for damn sure does not help people transition to D. Hell, even with the behavior of checking obj's invariant, you'd expect it to make sure the object is actually valid in the first place.

@yebblies
D Programming Language member

While I appreciate your enthusiasm, I'm the only one who gets notified when you post here. Posting on the newsgroup is likely to get more attention, and voting in bugzilla is always good too.

@WalterBright WalterBright merged commit 7d942b8 into dlang:master Jan 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment