//ww:run-exit 139 package main; type capture = struct { content: str, start: size, start_bytesize: size, end: size, end_bytesize: size, }; type thr = struct { pc: size, caps: []capture }; export fn main() i32 = { let c0: []capture = []; append(c0, capture { content = "x", start = 3: size, start_bytesize = 3: size, end = 8: size, end_bytesize = 8: size }); append(c0, capture { content = "yz", start = 5: size, start_bytesize = 5: size, end = 9: size, end_bytesize = 9: size }); let ts: []thr = []; append(ts, thr { pc = 0: size, caps = c0 }); let tsp = &ts; let dup: []capture = []; append(dup, (*tsp)[0].caps...); if (len(dup) != 2) { return 1; }; if (len(dup[1].content) != 2 || dup[1].content[0] != 'y') { return 2; }; let res: []capture = []; append(res, ts[0].caps...); if (len(res) != 2) { return 3; }; if (res[0].end != 8 || res[1].start != 5) { return 4; }; dup[0].start = 100: size; if (ts[0].caps[0].start != 3) { return 5; }; let acc = dup[0].start + dup[1].end + res[0].start + res[1].end_bytesize + ts[0].caps[0].end + (len(dup): size) * 5; return acc: i32; };