given the wrong code: ``` module runnable; void main() { struct A1 {} if (A1*) {} return; } ``` you get the error messages > /tmp/temp_7FA97E5E13D0.d(6,12): Error: expression expected, not `)`> > /tmp/temp_7FA97E5E13D0.d(6,14): Error: missing closing `)` after `if (A1 * 0` The second message is very bad. First it does not output the input. In no way we multiply by zero. Second the closing right paren is there.
@ntrel created dlang/dmd pull request #17055 "Fix Bugzilla 24848 - bad parser diagnostic for a partial MulExp" fixing this issue: - Fix Bugzilla 24848 - bad parser diagnostic for a partial MulExp https://github.com/dlang/dmd/pull/17055
> In no way we multiply by zero. This happens for pretty much any binary expression, the pull fixes that. This is the main bug IMO. > Second the closing right paren is there. I think there are many cases where subsequent parser error messages are confusing.
dlang/dmd pull request #17055 "Fix Bugzilla 24848 - bad parser diagnostic for a partial MulExp" was merged into master: - 5d01f144e2cc63a9c1c0edd5ab954a8edac11403 by Nick Treleaven: Fix Bugzilla 24848 - bad parser diagnostic for a partial MulExp https://github.com/dlang/dmd/pull/17055