Skip to content

Fix error message location for incompatible function arguments #21264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abulgit
Copy link
Contributor

@abulgit abulgit commented Apr 18, 2025

Closes: #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 abulgit changed the title Fix error message location Fix error message location for incompatible function arguments Apr 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong location for incompatible argument error
1 participant