Skip to content

Wrong location for incompatible argument error #21167

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
VPanteleev-S7 opened this issue Apr 7, 2025 · 0 comments · May be fixed by #21264
Open

Wrong location for incompatible argument error #21167

VPanteleev-S7 opened this issue Apr 7, 2025 · 0 comments · May be fixed by #21264

Comments

@VPanteleev-S7
Copy link
Contributor

void f(int, int, int){}

void main()
{
	f(
		1,
		"foo",
		3
	);
	
}

Output:

test.d(5): Error: function `f` is not callable using argument types `(int, string, int)`
test.d(5):        cannot pass argument `"foo"` of type `string` to parameter `int __param_1`
test.d(1):        `test.f(int __param_0, int __param_1, int __param_2)` declared here

The error is reported on line 5 (the function being called), but it would be more useful to report it on line 7 (the argument which does not match).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants