mirror of
https://github.com/ton-blockchain/ton
synced 2025-02-12 19:22:37 +00:00
15 lines
203 B
Text
15 lines
203 B
Text
|
|
||
|
fun inc(mutate x: int) {
|
||
|
x += 1;
|
||
|
}
|
||
|
|
||
|
fun cantPassToMutatingFunction() {
|
||
|
val myVal = 10;
|
||
|
inc(mutate myVal);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
@compilation_should_fail
|
||
|
@stderr modifying an immutable variable `myVal`
|
||
|
*/
|