//ww:run-exit 80 package main; type box = struct { pc: i64, a: i64 }; let calls: i64 = 0; fn lastidx(xs: []box) i64 = { calls += 1; let n: i64 = len(xs): i64; return n - 1; }; export fn main() i32 = { let bs: []box = []; append(bs, box { pc = 11, a = 1 }); append(bs, box { pc = 4242, a = 2 }); append(bs, bs[lastidx(bs)]); if (calls != 1) { return 1; }; if (len(bs) != 3) { return 2; }; if (bs[2].pc != 4242 || bs[2].a != 2) { return 3; }; if (bs[0].pc != 11) { return 4; }; return 80; };