-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 ==
and !=
when comparing signed vs unsigned integers
#6689
Fix ==
and !=
when comparing signed vs unsigned integers
#6689
Conversation
Why closing it? I was up to send the approval. |
@bcardiff Because it stucks at one spec, probably this broke something that depended on that equality. I'll reopen and investigate why it's failing, and try to fix that. |
5ffd993
to
fa524cc
Compare
Hopefully fixed. The |
fa524cc
to
d550776
Compare
@@ -161,6 +161,26 @@ class Crystal::CodeGenVisitor | |||
end | |||
end | |||
|
|||
# The below methods (lt, lt2, gt, gte, eq, ne) perform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/lt2/lte/
Bit of a nitpick but it genuinely confused me for 30s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Fixed!
d550776
to
6ffffd0
Compare
Amazing, you corrected the typo before I even had time to finish reading the whole diff! |
96426d8
to
cc2ab58
Compare
I keep adding fixes. This time, getting runtime integer values from LLVM returned |
CI still failing :C |
cc2ab58
to
97271b9
Compare
CI passed 🎉 |
spec/std/int_spec.cr
Outdated
@@ -537,6 +537,18 @@ describe "Int" do | |||
end | |||
end | |||
|
|||
{% if compare_versions(Crystal::VERSION, "2.6.1") > 0 %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asterite is this version correct? Shouldn't be 0.26.1
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops! Fixed :-)
97271b9
to
086f372
Compare
(x == y).should be_false | ||
(y == x).should be_false | ||
(x != y).should be_true | ||
(y != x).should be_true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be better to use should eq
and expectations to have a report of variables if it fails?should_not eq
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know, here we are testing those operators and I wouldn't like to hide them behind a spec matcher.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is better as-is
You guys are awesome. Thank you. |
Fixes #571