-
Notifications
You must be signed in to change notification settings - Fork 6
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
Remove as_bool in Instruction trait #404
Conversation
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 suuuuuch a nice cleanup. Thanks a lot, this is fantastic!
match self.op { | ||
Operator::Lt | ||
| Operator::Gt | ||
| Operator::LtEq | ||
| Operator::GtEq | ||
| Operator::Equals | ||
| Operator::NotEquals => CheckedType::Resolved(TypeId::from("bool")), | ||
_ => l_type, | ||
} |
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 think this might be missing checking that both the l_type and r_type are the same? Maybe I'm missing part of the function, I can't check it for now. If that is the case, could you add a test case for this as it is a typechecking error to operate on two types with different types and I should have added one already :)
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 done line 128. Don't know if this is tested though.
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.
Ah, great thanks for checking!
Co-authored-by: CohenArthur <arthur.cohen@epita.fr>
Fixes #387