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-04-02 11:50:14 +03:00
|
|
|
circuit TestMe {
|
2021-04-29 22:22:17 +03:00
|
|
|
x: u8;
|
2021-04-02 11:50:14 +03:00
|
|
|
|
|
|
|
function test_me(mut self) -> u8 {
|
|
|
|
self.x += 1;
|
2021-04-15 21:34:22 +03:00
|
|
|
return self.x;
|
2021-04-02 11:50:14 +03:00
|
|
|
}
|
2021-04-15 21:34:22 +03:00
|
|
|
|
|
|
|
function new() -> Self {
|
|
|
|
return Self { x: 1u8 };
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function my_fn() -> TestMe {
|
|
|
|
return TestMe { x: 0u8 };
|
2021-04-02 11:50:14 +03:00
|
|
|
}
|
|
|
|
|
2021-05-12 20:47:03 +03:00
|
|
|
function main(y: bool) -> bool {
|
2021-04-02 11:50:14 +03:00
|
|
|
const t = TestMe {x: 6u8}.test_me();
|
2021-04-15 21:34:22 +03:00
|
|
|
const u = my_fn().test_me();
|
|
|
|
const v = TestMe::new().test_me();
|
2021-05-12 20:47:03 +03:00
|
|
|
return v == 2u8 == y;
|
2021-05-05 11:37:51 +03:00
|
|
|
}
|