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

Add diagnostic for unnecessary function capture #2999

Open
u9g opened this issue Apr 17, 2024 · 2 comments
Open

Add diagnostic for unnecessary function capture #2999

u9g opened this issue Apr 17, 2024 · 2 comments
Labels
good first issue Good for newcomers help wanted Contributions encouraged priority:medium

Comments

@u9g
Copy link

u9g commented Apr 17, 2024

Thanks for all the work that has gone into the language and the diagnostics, they truly are amazing!

While going through the tutorial, it occurred to me after I wrote this and then removed the (_) that the function capture was completely unnecessary, but with no warning I'm sure this error exists in a ton of codebases already, and could be easily dealt with with a diagnostic added to the compiler.

  1
  |> int.to_string(_) // <-- (_) is unnecessary and can be removed without changing the meaning of the pipeline
  |> string.repeat(5)
  |> string.drop_left(2)
  |> io.println
@lpil
Copy link
Member

lpil commented Apr 18, 2024

This is a great idea! Thank you!

@lpil lpil added help wanted Contributions encouraged good first issue Good for newcomers priority:medium labels Apr 18, 2024
@giacomocavalieri
Copy link
Member

I can try and work on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Contributions encouraged priority:medium
Projects
None yet
Development

No branches or pull requests

3 participants