mirror of
https://github.com/ton-blockchain/ton
synced 2025-02-15 04:32:21 +00:00
16 lines
290 B
Text
16 lines
290 B
Text
|
fun incBoth(mutate x: int, mutate y: int) {
|
||
|
x += 10;
|
||
|
y += 10;
|
||
|
}
|
||
|
|
||
|
fun cantCallMutatingFunctionWithRvalue() {
|
||
|
var x = 10;
|
||
|
incBoth(mutate x, mutate 30);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
@compilation_should_fail
|
||
|
@stderr lvalue expected (call a mutating function)
|
||
|
@stderr incBoth(mutate x, mutate 30)
|
||
|
*/
|