wwstage: expand spread variants in match check + size them off flattened members (#209)
The wwstage checker walked a match's raw AST variant list and never expanded a ...inner spread variant, so it rejected fmt's match over field = (...formattable | *mods) ('not a variant of scrutinee'). cstage's resolve_type flattens the spread at type-build. Mirror that in the AST exhaustiveness walk (casevariantin + a recursive checkvariantcovered): when a variant resolves to N_TTAGGED via a spread, recurse into its members. Additive + spread-gated -- typeeqast / casevariantpairmatch (#13) / casecovers untouched, so non-spread matches and 990-997 byte-id are unaffected. Also size a spread N_TTAGGED off each flattened member (mirror cstage check.c), dropping the inner union tag word (field 40B to 32B). Closes the #209 CHECKER reject; full fmt-byte-id still awaits cgen cluster #226 (io.read nominal-remap) + #227 (spread-widen ABI), so fmt tests stay cstage-only with retargeted comments. Adds test 792; regenerates w6c/wwdump combined.ww.
This commit is contained in:
@@ -11,11 +11,12 @@
|
||||
* calls fprintf with a {:mods} format string + one arg, and asserts the
|
||||
* exact byte content read back.
|
||||
*
|
||||
* Cstage-only per row — pre-existing wwstage bug #209 (sibling of
|
||||
* #190): the wwstage checker bails on fmt.formattable match-arms
|
||||
* whenever a downstream probe `import fmt;`s the package. Identical
|
||||
* carve-out to 777_fmt_handle_run (cited there). Byte-id graduates with
|
||||
* #209 close.
|
||||
* Cstage-only per row. #209 (the wwstage checker bail on fmt's
|
||||
* spread-union match-arms) is now CLOSED; the residual blocker is the
|
||||
* pre-existing cgen cluster #226 (io.read error-remap nominal-identity)
|
||||
* + #227 (spread-union widen/return-ABI). Identical carve-out to
|
||||
* 777_fmt_handle_run (cited there). Byte-id graduates when #226 (+#227)
|
||||
* land.
|
||||
*
|
||||
* row | format | arg | expect | exit
|
||||
* -----------------+------------+--------------+-----------+-----
|
||||
@@ -44,8 +45,10 @@
|
||||
*
|
||||
* DEFERRALS / RELATED (NOT addressed by these rows):
|
||||
*
|
||||
* - #209 (wwstage formattable match-arm bail): blocks STAGE_WW here,
|
||||
* same as 777_fmt_handle_run. Cstage-only until close.
|
||||
* - #226 (io.read error-remap nominal-identity) + #227 (spread-union
|
||||
* widen/return-ABI): block STAGE_WW here, same as 777_fmt_handle_run.
|
||||
* #209 (the checker bail) is closed; these cgen folds are the
|
||||
* residual. Cstage-only until they land.
|
||||
*
|
||||
* BOOTSTRAP-EMBED CHECK: fmt is NOT embedded in any selfhost
|
||||
* combined.ww (grep confirmed), so the #5 fmt graduation does NOT
|
||||
|
||||
Reference in New Issue
Block a user