mirror of
https://github.com/ton-blockchain/ton
synced 2025-02-12 19:22:37 +00:00
17 lines
323 B
Text
17 lines
323 B
Text
|
const op_increase = 0x123;
|
||
|
|
||
|
fun inc(mutate x: int): int {
|
||
|
x += 10;
|
||
|
return x + 1;
|
||
|
}
|
||
|
|
||
|
fun cantCallMutatingFunctionWithImmutable() {
|
||
|
return inc(mutate op_increase);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
@compilation_should_fail
|
||
|
@stderr modifying an immutable variable `op_increase` (call a mutating function)
|
||
|
@stderr inc(mutate op_increase)
|
||
|
*/
|