Skip to content

Lint/LiteralsComparison: false positive when comparing tuple #400

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

Closed
ysbaddaden opened this issue Sep 12, 2023 · 0 comments · Fixed by #417
Closed

Lint/LiteralsComparison: false positive when comparing tuple #400

ysbaddaden opened this issue Sep 12, 2023 · 0 comments · Fixed by #417
Assignees
Milestone

Comments

@ysbaddaden
Copy link

ysbaddaden commented Sep 12, 2023

The following causes Lint/LiteralsComparison to fail:

start = Time.utc(2023, 9, 1)
stop = Time.utc(2023, 9, 2)
{start.year, start.month} == {stop.year, stop.month}
$ ameba foo.cr
foo.cr:3:1
[W] Lint/LiteralsComparison: Comparison most likely evaluates to false
> {start.year, start.month} == {stop.year, stop.month}
  ^--------------------------------------------------^

Tested on Ameba 1.4.3

@Sija Sija changed the title Lint/LiteralsComparison: false positive when comparing tuple Lint/LiteralsComparison: false positive when comparing tuple Nov 9, 2023
@Sija Sija self-assigned this Nov 9, 2023
@Sija Sija added this to the 1.6.0 milestone Nov 9, 2023
@Sija Sija closed this as completed in #417 Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants