Why do failed contracts don't dump stack backtrace in unittests?

Ali Çehreli acehreli at yahoo.com
Sun Sep 4 14:14:55 UTC 2022


The program output is different whether an Error is thrown from main or 
from the unittest block:

void foo(string s)
in (s != "hello") {
}

unittest {
   foo("hello");  // No stack backtrace
}

void main() {
   foo("hello");  // Yes stack backtrace
}

Ali


More information about the Digitalmars-d-learn mailing list