leo/compiler/tests/mutability/circuit_variable_mut.leo
2020-09-02 18:01:47 -07:00

11 lines
190 B
Plaintext

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