1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-02-15 04:32:21 +00:00
ton/tolk-tester/tests/invalid-mutate-5.tolk

15 lines
321 B
Text
Raw Normal View History

fun cantCallMutatingMethod(c: cell) {
val s: slice = c.beginParse();
if (1) {
var s: slice = c.beginParse();
s.loadRef(); // this is ok, 's' is another variable
}
val i = s.loadUint(32);
}
/**
@compilation_should_fail
@stderr modifying immutable variable `s`
@stderr s.loadUint
*/