1
1
mirror of https://github.com/AleoHQ/leo.git synced 2024-12-30 05:02:04 +03:00
leo/tests/compiler/circuits/const_self_variable.leo

20 lines
274 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-05-12 20:47:03 +03:00
return 1u8 == f.use_a() == true;
2021-05-05 11:37:51 +03:00
}