EndeavourOS/Arch x86_64, dmd 2.107.0, ldc 1.36.0, also 1.37.0-beta1.
The messages of asserts thrown during CTFE are replaced with "null" iff they were derived from a thrown exception's message and iff the program is built with -dip1008 enabled.
```d
#!/usr/bin/env dub
/+ dub.sdl:
name "app"
dflags "-dip1008"
+/
void main() {}
static immutable ctfeThing =
{
try
{
throw new Exception("message");
}
catch (Exception e)
{
assert(0, e.msg);
}
return 0;
}();
```
```
app.d(17,9): Error: null
app.d(20,2): called from here: `(*function () pure nothrow @nogc @safe => 0)()`
Error /usr/bin/dmd failed with exit code 1.
```
Expected is "Error: message", and you do get that if you disable -dip1008.
Comment #1 by zorael — 2024-02-10T13:36:25Z
The behaviour changed in 2.101, before which the error message was `"message"[0..7]`.
```
$ dub build --compiler=2.100/dmd 2>&1 | grep 'Error:'
source/app.d(17,9): Error: `"message"[0..7]`
$ dub build --compiler=2.101/dmd 2>&1 | grep 'Error:'
source/app.d(17,9): Error: `null`
```
Comment #2 by contact — 2024-08-05T06:27:55Z
I can confirm regression:
```
2.085.1 to 2.100.2: Failure with output: onlineapp.d(25): Error: static assert: "Incorrect format specifier for range: %d"
Since 2.101.2: Success and no output
```
Comment #3 by robert.schadek — 2024-12-13T19:33:11Z