leo/asg/tests/pass/mutability/circuit_mut.leo

11 lines
183 B
Plaintext
Raw Normal View History

2021-01-25 18:17:42 +03:00
// Adding the `mut` keyword makes a circuit variable mutable.
circuit Foo {
x: u32;
2021-01-25 18:17:42 +03:00
}
function main() {
let a = Foo { x: 1 };
2021-01-25 18:17:42 +03:00
a.x = 0;
console.assert(a.x == 0u32);
}