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

fix(expression checker): prevent identifier warnings for closures #1217

Merged
merged 2 commits into from
Jan 13, 2025

Conversation

pront
Copy link
Member

@pront pront commented Jan 9, 2025

Summary

Do not warn for unused variable inside closures. There are a lot details on the linked issues.

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

How did you test this PR?

Added unit test.

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on
    our guidelines.
  • No. A maintainer will apply the "no-changelog" label to this PR.

Checklist

  • Our CONTRIBUTING.md is a good starting place.
  • If this PR introduces changes to LICENSE-3rdparty.csv, please
    run dd-rust-license-tool write and commit the changes. More details here.
  • For new VRL functions, please also create a sibling PR in Vector to document the new function.

References

Ref: #1216

@pront pront added the no-changelog Changes in this PR do not need user-facing explanations in the release changelog label Jan 9, 2025
@pront pront requested a review from jszwedko January 9, 2025 18:51
Copy link
Member

@jszwedko jszwedko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not super familiar with the VRL compiler internals, but the test looks good and I can't spot anything off in the implementation.

@pront pront added this pull request to the merge queue Jan 13, 2025
@pront pront added the vrl: expression checker Anything related to the expression checking phase which happens after source compilation. label Jan 13, 2025
Merged via the queue into main with commit 20f2167 Jan 13, 2025
16 checks passed
@pront pront deleted the pront/unused-checker-closure-ignore-idents branch January 13, 2025 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Changes in this PR do not need user-facing explanations in the release changelog vrl: expression checker Anything related to the expression checking phase which happens after source compilation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unused checker reports variable used in if-condition inside for_each block as unused
2 participants