mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-18 15:31:32 +03:00
23 lines
341 B
Plaintext
23 lines
341 B
Plaintext
/*
|
|
namespace: Compile
|
|
expectation: Fail
|
|
input_file: input/dummy.in
|
|
*/
|
|
|
|
circuit Foo {
|
|
x: u32
|
|
|
|
function foo(mut self) {
|
|
self.x = 10;
|
|
}
|
|
}
|
|
|
|
// cannot call mutable member function 'foo' of circuit 'Foo' from immutable context
|
|
function main() -> bool {
|
|
const a = Foo { x: 1 };
|
|
|
|
a.foo();
|
|
|
|
return a.x == 10u32;
|
|
}
|