leo/asg/tests/pass/circuits/mut_self_variable_conditional.leo

15 lines
249 B
Plaintext
Raw Normal View History

2021-01-25 18:17:42 +03:00
function main() {
let f = Foo { a: 0u32 };
2021-01-25 18:17:42 +03:00
f.bar();
}
circuit Foo {
a: u32;
2021-01-25 18:17:42 +03:00
function bar(mut self) {
if true {
self.a = 5u32; // Mutating a variable inside a conditional statement should work.
}
}
}