This D2 program: void main() { assert(0, "This is a message"); } With dmd 2.048 prints: object.Error: assert(0) or HLT instruction It doesn't print the line number nor the "This is a message".
assert(0) is special. It's not meant for debugging, it's meant as a "this piece of code should never have been reached, shut down the application", at least in release mode. From TDPL: "In non-release mode, assert(false) does not do anything special, it just throws an AssertError exception" "In release mode assert(false) will always cause a program to stop. There will be no exception, the program will crash by executing the HLT instruction"
You are right, thank you. I have erroneously compiled it in release mode. There is no bug here.