leo/compiler/tests/circuits/member_variable_and_function.leo

16 lines
203 B
Plaintext
Raw Normal View History

2020-06-20 11:40:56 +03:00
circuit Foo {
2020-06-29 23:05:41 +03:00
foo: u32,
2020-06-20 11:40:56 +03:00
2020-12-01 23:37:44 +03:00
function bar() -> u32 {
2020-07-30 21:11:54 +03:00
return 1u32
2020-06-20 11:40:56 +03:00
}
}
2020-07-30 21:11:54 +03:00
function main() {
const a = Foo { foo: 1 };
2020-07-30 21:11:54 +03:00
const b = a.foo + Foo::bar();
2020-07-30 21:11:54 +03:00
2020-08-17 03:20:47 +03:00
console.assert(b == 2u32);
2020-06-20 11:40:56 +03:00
}