diff --git a/compiler/parser/src/parser/expression.rs b/compiler/parser/src/parser/expression.rs index 57bd57e4c8..15936c3f88 100644 --- a/compiler/parser/src/parser/expression.rs +++ b/compiler/parser/src/parser/expression.rs @@ -226,11 +226,11 @@ impl ParserContext<'_> { // Check if the method exists. let index = method.as_u32(); - if index <= 2 { + if index <= 1 { // Binary operators. let operator = match index { - 1 => BinaryOperation::Add, - 2 => BinaryOperation::AddWrapped, + 0 => BinaryOperation::Add, + 1 => BinaryOperation::AddWrapped, _ => unimplemented!("throw error for invalid method call") }; diff --git a/examples/hello-world/src/main.leo b/examples/hello-world/src/main.leo index c35404f1b3..e664959fb7 100644 --- a/examples/hello-world/src/main.leo +++ b/examples/hello-world/src/main.leo @@ -1,3 +1,3 @@ function main(a: u8, b: u8) -> u8 { - return a.add(b); + return a.add_wrapped(b); } \ No newline at end of file diff --git a/leo/span/src/symbol.rs b/leo/span/src/symbol.rs index 37f26b96ac..2470027927 100644 --- a/leo/span/src/symbol.rs +++ b/leo/span/src/symbol.rs @@ -104,7 +104,7 @@ symbols! { // binary operators add, - add_w, + add_wrapped, // arity three operators