Skip to content
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

Check argument count #49

Open
ghost opened this issue Feb 2, 2022 · 3 comments
Open

Check argument count #49

ghost opened this issue Feb 2, 2022 · 3 comments

Comments

@ghost
Copy link

ghost commented Feb 2, 2022

It would be nice to check argument count in function calls 😃

@alerque
Copy link
Member

alerque commented Feb 3, 2022

How would you imagine this working? What exactly would we even be looking for? I don't see how this would be remotely possible in the current architecture. It seems like could only be implemented by a Lua runtime and impossible to discern with any degree of meaningfulness from just a syntax parser / linter — but perhaps I'm missing what you expect.

@appgurueu
Copy link

With very basic data flow analysis reliability could be achieved at least for local functions which are only defined once (or where only one definition may reach a certain place), so something like the following could be warned about:

local function f(a, b) ... end
f(1)

but due to Lua's dynamic dispatch, a general solution is not possible

@alerque
Copy link
Member

alerque commented May 22, 2023

I'm not convinced even a local-only approach would be feasible but I'm be willing to review a PR if somebody implements this at least to POC stage.

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

No branches or pull requests

2 participants