leo/compiler/tests/circuits/member_function_nested.leo

19 lines
282 B
Plaintext
Raw Normal View History

circuit Foo {
x: u32,
function add_x(y: u32) -> u32 {
return self.x + y
}
function call_add_x(y: u32) -> u32 {
return self.add_x(y)
}
}
2020-07-30 21:11:54 +03:00
function main() {
let a = Foo { x: 1u32 };
let b = a.call_add_x(1u32);
2020-07-30 21:11:54 +03:00
assert_eq!(b, 2u32);
}