leo/tests/compiler/mutability/circuit_variable_mut.leo
2021-05-03 17:28:53 +03:00

16 lines
211 B
Plaintext

/*
namespace: Compile
expectation: Pass
*/
circuit Foo {
x: u32
}
// Using let makes a circuit variable mutable.
function main() {
let a = Foo { x: 1 };
a.x = 0;
console.assert(a.x == 0u32);
}