When compiling with -checkaction=context: ```D void main() { const x = -1L; const y = -2L; assert(x == y); } ``` expected: -1 != -2 actual: assert(x == y) failed Also applies to floating points. I don't know why it fails to give context here. Making either x or y mutable makes it work. Also: ```D void main() { const long[1] x = [uint.max]; const long[1] y = [-1]; assert(x == y); } ``` expected: [4294967296] != [-1] actual: [-1] != [-1] This is because in core.internal.dassert: getPrintfFormat there is a check: static if (is(T == long)) This doesn't Unqual T so it doesn't hold when T == const(long), so it chooses the wrong format.
The second error was fixed as a side effect of https://github.com/dlang/druntime/pull/2846/
@MoonlightSentinel created dlang/dmd pull request #10535 "Fix Issue 20353 - -checkaction=context does not work well with const …" fixing this issue: - Fix Issue 20353 - -checkaction=context does not work well with const numbers https://github.com/dlang/dmd/pull/10535
fixed by https://github.com/dlang/dmd/pull/11005