leo/compiler/tests/canonicalization/compound_assignment.leo

13 lines
213 B
Plaintext
Raw Normal View History

function main() {
2021-03-26 08:52:58 +03:00
let x = 10u32;
x += 20;
2021-03-26 23:51:03 +03:00
console.assert(x == 30u32);
let y = [1u8, 2u8];
y[0] += 3u8;
console.assert(y[0] == 4u8);
let z = (1u8, 2u8);
z.1 += 3u8;
console.assert(z.1 == 5u8);
}