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?]: Lambda arguments starting with underscore are always allowed #78

Closed
sivizius opened this issue May 3, 2024 · 1 comment
Closed

Comments

@sivizius
Copy link

sivizius commented May 3, 2024

Due to https://github.com/astro/deadnix/blob/main/src/scope.rs#L105, lambda arguments starting with _ are always allowed, even without --no-underscore. This behaviour is different from other bindings, e.g. let _foo = 23; in …, where --no-underscore is necessary, and thus unexpected. I suggest to either change this to name.syntax().text() != "_" or remove this flag and always allow symbols starting with _, even in let-bindings, which is the default in many programming languages including rust.

@astro
Copy link
Owner

astro commented May 3, 2024

I agree that this behavior seems inconsistent.

The LambdaArg case however is a bit special because it cannot be removed entirely. Renaming them to _ makes code less self-explanatory. I'd like to reconsider about that for a few days.

Against the alternative proposal, I think finding dead declarations that start with _ is very useful.

astro added a commit that referenced this issue Oct 27, 2024
@astro astro closed this as completed Oct 27, 2024
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

No branches or pull requests

2 participants