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

[Bug] Positional and optional arguments not properly distinguished by runtime #281

Open
softmattertheory opened this issue Nov 29, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@softmattertheory
Copy link
Contributor

Describe the bug
A function call with optional arguments may occasionally match an implementation with positional arguments.

To Reproduce
A minimal example that runs and shouldn't:

fn f(x,y,z,a) { return -1 }

print f(1,z=3)

Expected behavior
The above example should generate an error e.g. 'InvldArgs'

Additional context
The underlying problem is that the CALL opcode doesn't specify the number of positional arguments, so the runtime infers them if it is expecting optional arguments.

@softmattertheory softmattertheory added the bug Something isn't working label Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant