leo/tests/compiler/circuits/const_self_variable.leo

20 lines
276 B
Plaintext
Raw Normal View History

2021-05-05 11:37:51 +03:00
/*
namespace: Compile
expectation: Pass
2021-05-12 20:47:03 +03:00
input_file: input/dummy.in
2021-05-05 11:37:51 +03:00
*/
2021-03-25 23:52:43 +03:00
circuit Foo {
a: u8;
2021-03-25 23:52:43 +03:00
function use_a(const self) -> u8 {
return self.a + 1;
2021-03-25 23:52:43 +03:00
}
}
2021-05-12 20:47:03 +03:00
function main(y: bool) -> bool {
2021-03-25 23:52:43 +03:00
let f = Foo { a: 0u8 };
2021-07-01 23:40:29 +03:00
return (1u8 == f.use_a()) == true;
2021-05-05 11:37:51 +03:00
}