leo/tests/compiler/circuits/const_self_variable.leo

19 lines
233 B
Plaintext
Raw Normal View History

2021-05-05 11:37:51 +03:00
/*
namespace: Compile
expectation: Pass
*/
2021-03-25 23:52:43 +03:00
circuit Foo {
a: u8,
function use_a(const self) -> u8 {
return self.a + 1;
2021-03-25 23:52:43 +03:00
}
}
function main() {
let f = Foo { a: 0u8 };
console.assert(1u8 == f.use_a());
2021-05-05 11:37:51 +03:00
}