dmd icon indicating copy to clipboard operation
dmd copied to clipboard

Fix error message location for incompatible function arguments

Open abulgit opened this issue 6 months ago • 0 comments

Closes: https://github.com/dlang/dmd/issues/21167

So the error message should point to the line with the problematic argument rather than the line where the function call starts. So here's what I did -

  1. Updated the callMatch function in typesem.d to pass the argument's location to the error helper
  2. Modified the error helper functions in expressionsem.d and funcsem.d to accept and use the argument's location also updated the functionResolve function in templatesem.d to accept the modified error helper delegate
  3. Also added a test case in fail_compilation/fix21167.d to verify the fix

abulgit avatar Apr 18 '25 19:04 abulgit