leo/asg/tests/pass/mutability/circuit_variable_mut.leo

11 lines
186 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
}
function main() {
let mut a = Foo { x: 1 };
a.x = 0;
console.assert(a.x == 0u32);
}