zls icon indicating copy to clipboard operation
zls copied to clipboard

error for mismatched number of function arguments

Open xdBronch opened this issue 2 years ago • 3 comments

fn foo(_: u32, _: u32) void {}

foo(0); // expected 2 arguments, found 1

as far as i can tell this should be doable without any kind of type analysis since functions cant be generated. in cases where zls cant properly resolve functions like from usingnamespace it could just not issue any errors

xdBronch avatar Dec 10 '23 02:12 xdBronch

ZLS could resolve the wrong function which may produce a a false-positive.

Techatrix avatar Dec 10 '23 02:12 Techatrix

oh hm thats true. when can zls resolve the wrong function? im guessing in scenarios like std.os.system. where there are duplicates of functions, maybe errors can be ignored if it sees multiples? but at that point it may become too complex and limited to be worth it

xdBronch avatar Dec 10 '23 02:12 xdBronch

Its just a hypothetical so maybe this works fine. I can give this idea a chance and see if there are issues.

Techatrix avatar Dec 10 '23 03:12 Techatrix