Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

False positive in pointless-reassignment when array on left hand side #1285

Closed
anderseknert opened this issue Dec 3, 2024 · 0 comments · Fixed by #1286
Closed

False positive in pointless-reassignment when array on left hand side #1285

anderseknert opened this issue Dec 3, 2024 · 0 comments · Fixed by #1286
Labels
bug Something isn't working rule

Comments

@anderseknert
Copy link
Member

Originally reported in #1277, but the two issues turned out to be unrelated, so I'm creating a separate issue for this.

This is currently reported as a pointless reassignment, but that should only apply when there is a single var on either side of the assignment:

parts := split(input.parts, ".")

s contains [b, a] if {
	[a, b] := parts
}
@anderseknert anderseknert added bug Something isn't working rule labels Dec 3, 2024
anderseknert added a commit that referenced this issue Dec 3, 2024
That would happen despite the left hand side not being a var

Fixes #1285

Signed-off-by: Anders Eknert <anders@styra.com>
anderseknert added a commit that referenced this issue Dec 4, 2024
That would happen despite the left hand side not being a var

Fixes #1285

Signed-off-by: Anders Eknert <anders@styra.com>
anderseknert added a commit that referenced this issue Dec 4, 2024
That would happen despite the left hand side not being a var

Fixes #1285

Signed-off-by: Anders Eknert <anders@styra.com>
charlieegan3 pushed a commit to charlieegan3/regal that referenced this issue Jan 6, 2025
That would happen despite the left hand side not being a var

Fixes StyraInc#1285

Signed-off-by: Anders Eknert <anders@styra.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working rule
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant