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:
@@ -15,9 +15,12 @@
|
||||
* scanline / finish.
|
||||
*
|
||||
* Each row imports os + bufio + memio + io (NOT fmt — bufio doesn't
|
||||
* transitively pull fmt, so #209's formattable-match bail doesn't
|
||||
* propagate; both stages run on every row, cs.s==ww.s — bufio is NOT
|
||||
* compiler-embedded, so these byte-id rows are its ONLY byte-id cover).
|
||||
* transitively pull fmt, so it dodges the fmt-presence cgen cluster
|
||||
* #226 (io.read error-remap nominal-identity) + #227 (spread-union
|
||||
* widen/return-ABI) that blocks the fmt-importing tests' byte-id; both
|
||||
* stages run on every row, cs.s==ww.s — bufio is NOT compiler-embedded,
|
||||
* so these byte-id rows are its ONLY byte-id cover). (#209, the wwstage
|
||||
* formattable match-arm CHECKER bail, is now closed.)
|
||||
*
|
||||
* row | what it pins
|
||||
* --------------------------+--------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user