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

Improvements on unused argument detection in { foo, bar }@args #558

Closed
Aleksanaa opened this issue Jul 31, 2024 · 1 comment · Fixed by #565
Closed

Improvements on unused argument detection in { foo, bar }@args #558

Aleksanaa opened this issue Jul 31, 2024 · 1 comment · Fixed by #565

Comments

@Aleksanaa
Copy link
Collaborator

Aleksanaa commented Jul 31, 2024

Is your feature request related to a problem? Please describe.
NixOS/nixpkgs#331085

Describe the solution you'd like
Don't report unused argument when using together with @args pattern, but do report unused argument if they have a default value in this case (the default value won't take effect)

nix-repl> foo = { a ? 1 }@args: args

nix-repl> bar = foo {}               

nix-repl> bar
{ }

Here a should be reported to be unused (maybe add a new error type)

Additional context
NixOS/nixpkgs#331085
NixOS/nixpkgs#330589

@inclyc
Copy link
Member

inclyc commented Jul 31, 2024

Maybe split these two improvements to two issues. The first one seems to be a bug, and bugs usually have higher priority than feature requests.

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

Successfully merging a pull request may close this issue.

2 participants