leo/compiler/tests/mutability/circuit_static_function_mut.leo

9 lines
165 B
Plaintext
Raw Normal View History

2020-09-03 04:01:47 +03:00
// Adding the `mut` keyword makes a circuit variable mutable.
circuit Foo {
2020-12-01 19:54:51 +03:00
function bar() {}
2020-09-03 04:01:47 +03:00
}
function main() {
let mut a = Foo { x: 1 };
a.bar = 0;
}