Files
ww/test/wcc/data/r76_infer_struct_i32_x3/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

7 lines
394 B
Plaintext

//ww:run-exit 6
package main;
type three = struct { a: i32, b: i32, c: i32 };
fn make(flag: i32) three = { if (flag == 0) { return three { a = 1i32, b = 2i32, c = 3i32 }; }; return three { a = 10i32, b = 20i32, c = 30i32 }; };
fn use_(p: three, which: i32) i32 = { if (which == 0) { return p.a + p.b + p.c; }; return p.a * p.b * p.c; };
fn main() i32 = { let p = make(0); return use_(p, 0); };