leo/compiler/tests/mutability/circuit_mut.leo
2020-08-16 19:14:26 -07:00

11 lines
186 B
Plaintext

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