leo/compiler/tests/circuits/member_variable_and_function.leo

16 lines
206 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
static 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() {
let a = Foo { foo: 1 };
let b = a.foo + Foo::bar();
2020-08-17 03:20:47 +03:00
console.assert(b == 2u32);
2020-06-20 11:40:56 +03:00
}