tact-lang / tact

Tact compiler main repository
https://tact-lang.org
MIT License
267 stars 53 forks source link

Chaining for mutable functions does not work with struct fields #385

Closed anton-trunov closed 1 week ago

anton-trunov commented 1 week ago

PR #384 fixed chaining for identifiers, however the following test returns the wrong result:

struct Foo {
    s: Slice;
}

contract Test {
    init() {}
    receive() {}

    get fun test8(): Int {
        let foo: Foo = Foo {
              s: beginCell()
                 .storeUint(3, 2)
                 .storeUint(1, 2)
                 .endCell().asSlice(),  // bits: 1101
            };
        foo.s.loadBits(1); // should mutate foo.s, making it point to 101
        return foo.s.loadUint(3);  // if the previous line mutated foo.s, should return 5, otherwise 6
    }
}