//ww:run-exit 47 package main; type t = struct { pc: size, matched: bool }; fn geti() size = { return 1; }; fn setpc(ts: *[]t) void = { (*ts)[geti()].pc = 9; }; fn bump(ts: *[]t) void = { (*ts)[geti()].pc += 1; }; export fn main() i32 = { let ts: []t = []; append(ts, t { pc = 1, matched = false }); append(ts, t { pc = 2, matched = false }); setpc(&ts); if (ts[1].pc != 9) { return 1; }; bump(&ts); if (ts[1].pc != 10) { return 2; }; if (ts[0].pc != 1) { return 3; }; return 47; };