Skip to content

Wrong location for incompatible argument error #21167

Open
@VPanteleev-S7

Description

@VPanteleev-S7
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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions