2021-05-05 11:37:51 +03:00
|
|
|
/*
|
|
|
|
namespace: Compile
|
|
|
|
expectation: Pass
|
|
|
|
inputs:
|
|
|
|
- inline.in: |
|
|
|
|
[main]
|
2021-05-06 14:27:42 +03:00
|
|
|
y: bool = true;
|
|
|
|
|
|
|
|
[constants]
|
2021-05-05 11:37:51 +03:00
|
|
|
x: u8 = 10;
|
|
|
|
|
|
|
|
[registers]
|
|
|
|
r0: bool = false;
|
|
|
|
*/
|
|
|
|
|
2021-02-05 00:18:28 +03:00
|
|
|
circuit Foo {
|
|
|
|
x: u8
|
|
|
|
|
|
|
|
function new(x: u8) -> Self {
|
2021-04-14 23:59:07 +03:00
|
|
|
return Self { x };
|
2021-02-05 00:18:28 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-06 14:27:42 +03:00
|
|
|
function main(const x: u8, y: bool) -> bool {
|
2021-03-18 22:19:07 +03:00
|
|
|
const a = Foo { x };
|
|
|
|
const b = Foo::new(x);
|
2021-05-05 11:37:51 +03:00
|
|
|
|
2021-07-01 23:40:29 +03:00
|
|
|
return (b.x == a.x) == y;
|
2021-05-05 11:37:51 +03:00
|
|
|
}
|