leo/compiler/tests/mutability/circuit_mut.leo
2020-07-17 12:59:18 -07:00

11 lines
175 B
Plaintext

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