fix symbol index bug

This commit is contained in:
collin 2022-06-09 13:16:54 -07:00
parent 9797175f16
commit 1b4e37e66e
3 changed files with 5 additions and 5 deletions

View File

@ -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")
};

View File

@ -1,3 +1,3 @@
function main(a: u8, b: u8) -> u8 {
return a.add(b);
return a.add_wrapped(b);
}

View File

@ -104,7 +104,7 @@ symbols! {
// binary operators
add,
add_w,
add_wrapped,
// arity three operators