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

25 lines
521 B
Plaintext

// Legacy neg_mcase, now a positive match-arm case. The import supplies the
// tagged value before the arm binder exists; inside that arm shadowmod is the
// closer i64 binding. Builds and runs 42.
package main;
import shadowmod;
fn parse(n: i64) (i64 | i32) = {
if (n < 0i64) {
return 1i32;
};
return n;
};
fn main() i32 = {
let r: (i64 | i32) = parse(shadowmod.say(): i64);
let out: i64 = 0i64;
match (r) {
case let shadowmod: i64 => out = shadowmod;
case let e: i32 => return e;
};
return out: i32;
};