int foo(int x) in { assert(x >= 0); // line 3. } body { return x ^^ 2; } void main() { foo(-1); // line 8. } With DMD 2.064alpha it gives at run-time: core.exception.AssertError@temp(3): Assertion failure followed by the stack trace. To speed up my debugging I suggest to instead generate two error messages similar to (the second line is the same as before): temp.d(8): Pre-condition violation: x >= 0 (x = -1) core.exception.AssertError@temp(3): Assertion failure
This seems to add little benefit as the stack trace contains the line numbers.