Files
ww/test/wcc/data/r811_boxed_prebound/case.ww
Hojun-Cho d456263f7e test/wcc/data: grow the declarative compiler corpus to 1,224 fixtures
The r-prefixed waves absorb the runtime, reject, and byte-compare rows
of the migrated native carriers; each fixture is one directory with one
case.ww and a //ww:error, //ww:compile, //ww:run, or //ww:run-exit
directive covering both frontends.
2026-08-07 23:21:04 +09:00

13 lines
652 B
Plaintext

//ww:run-exit 103
package main;
type inst_lit = rune;
type rep3 = struct { id: size, min: (void | size), max: (void | size) };
type inst = (inst_lit | rep3);
export fn main() i32 = {
let r = rep3 { id = 0: size, min = void, max = void }; r.id = 1; r.min = 2: size; r.max = 5: size;
let pre = 0: size; if (r.min is size) { pre += r.min as size; }; if (pre != 2) { return 200 + pre: i32; };
let v: inst = r; let acc = 0: size;
match (v) { case let ir: rep3 => { acc += ir.id; if (ir.min is size) { acc += ir.min as size; }; if (ir.max is size && ir.max as size == 5) { acc += 100; }; }; case let l: inst_lit => { acc += 1; }; };
return acc: i32;
};