w6c: remap legacy-union error tags in wwstage ? propagation
The #173 remap loop in cgtryprop gated on the tparam's explicit `!` flag only; a LEGACY union (no marks anywhere) classifies error variants POSITIONALLY (index 0 is success, cstage cg_variant_is_error cgen.c:905) — so wwstage emitted no remap and propagated the callee's raw tag into a differently-ordered caller union, a silent wrong arm (cstage exit 7, wwstage 9 on the banked r700 row). Add the variantiserror twin and gate the loop on it; refresh the drifted cstage cite. Graduates the held e2e row into the corpus (pin 1727/1156/3454) and adds legacy-mode rows to test/lang/tryprop_tag_remap_test.ww: reversed order both directions, slot-0 remap, str payload integrity, a two-hop chain whose pre-fix runtime pass was double-miss tag cancellation (the lang byteid leg pins the emitted remap blocks), and a same-order zero-emission control.
This commit is contained in:
21
test/wcc/data/r700_try_rev_errs/case.ww
Normal file
21
test/wcc/data/r700_try_rev_errs/case.ww
Normal file
@@ -0,0 +1,21 @@
|
||||
//ww:run-exit 7
|
||||
// Migrated from 700_e2e row 69.
|
||||
package main;
|
||||
fn inner(n: i32) (i32 | str | bool) = {
|
||||
if (n == 0) { return "z"; };
|
||||
if (n < 0) { return false; };
|
||||
return n;
|
||||
};
|
||||
fn outer(n: i32) (i64 | bool | str) = {
|
||||
let v: i32 = inner(n)?;
|
||||
return v: i64 + 1000;
|
||||
};
|
||||
fn main() i32 = {
|
||||
let r: (i64 | bool | str) = outer(-1);
|
||||
match (r) {
|
||||
case let n: i64 => return n: i32;
|
||||
case let b: bool => { if (!b) { return 7; }; return 8; };
|
||||
case let s: str => return 9;
|
||||
};
|
||||
return 0;
|
||||
};
|
||||
Reference in New Issue
Block a user