Files
ww/test/wcc/data/paramshadowmod/neg_forrange_tuple.ww

23 lines
502 B
Plaintext

// Legacy neg_forrange_tuple, now a positive tuple-range case. The import
// initializes total; the loop's first tuple element is the closer shadowmod
// binding. Builds and runs 42 + 1 + 2 = 45.
package main;
import shadowmod;
fn main() i32 = {
let buf: [2]i64;
buf[0] = 1i64;
buf[1] = 2i64;
let s: [](i64, i64);
s.ptr = buf.ptr: *(i64, i64);
s.len = 1;
s.cap = 1;
let total: i64 = shadowmod.say(): i64;
for (let (shadowmod, x) .. s) {
total += shadowmod + x;
};
return total: i32;
};