mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-11-23 23:23:50 +03:00
lt, gt, lte, gte for address
This commit is contained in:
parent
99605f46a5
commit
f7a55de9a6
@ -406,11 +406,19 @@ impl<'a> ExpressionVisitorDirector<'a> for Director<'a> {
|
||||
)
|
||||
}
|
||||
BinaryOperation::Lt | BinaryOperation::Gt | BinaryOperation::Lte | BinaryOperation::Gte => {
|
||||
// Assert left and right are equal field, scalar, or integer types.
|
||||
// Assert left and right are equal address, field, scalar, or integer types.
|
||||
let t1 = self.visit_expression(&input.left, &None);
|
||||
let t2 = self.visit_expression(&input.right, &None);
|
||||
|
||||
match (t1, t2) {
|
||||
(Some(Type::Address), t2) => {
|
||||
// Assert rhs is address.
|
||||
self.visitor.assert_expected_type(&t2, Type::Address, input.left.span());
|
||||
}
|
||||
(t1, Some(Type::Address)) => {
|
||||
// Assert lhs is address.
|
||||
self.visitor.assert_expected_type(&t1, Type::Address, input.right.span());
|
||||
}
|
||||
(Some(Type::Field), t2) => {
|
||||
// Assert rhs is field.
|
||||
self.visitor.assert_expected_type(&t2, Type::Field, input.left.span());
|
||||
|
Loading…
Reference in New Issue
Block a user