---
void main()
{
mydata data;
assert(check(&data));
}
struct mydata
{
int a, b, c;
}
bool check(mydata* p)
{
return p.a == 1 && p.b == 2 && p.c == 3;
}
---
% dmd -checkaction=C -run asserttest.d
dmd_runzAP3V1: asserttest.d:4: Assertion `check(& data)' failed.
% dmd -inline -checkaction=C -run asserttest.d
dmd_runJ6qb9y: asserttest.d:12: Assertion `(mydata* p = & data;) , (*p).a == 1 && ((*p).b == 2) && ((*p).c == 3)' failed.
two problems with the output:
- the line number of the assert statement is replaced with the line number of the inlined code
- the original expression in the message is replaced with the inlined function's contents
Comment #1 by robert.schadek — 2024-12-13T19:20:08Z