1
1
mirror of https://github.com/AleoHQ/leo.git synced 2024-12-30 13:12:53 +03:00
leo/tests/compiler/mutability/circuit_variable_mut.leo
2021-04-19 18:08:14 -07:00

11 lines
182 B
Plaintext

// Adding the `mut` keyword makes a circuit variable mutable.
circuit Foo {
x: u32
}
function main() {
let a = Foo { x: 1 };
a.x = 0;
console.assert(a.x == 0u32);
}