wcc/ww: flexible rune-const promotion at scalar seams (coercerunelit)

wwstage stamped N_RUNELIT as concrete rune (cstage: untyped_rune,
check.c:1296), so an uncast rune literal into a fitting integer slot
over-rejected where harec accepts (promote_flexible). Add coercerunelit
(mirror of coercefloatlit) at the scalar seams — let-init, return,
call-arg, index-store; coarse accept, no range check (mirror cstage
type.c:379); array-literal elements keep the range gate
(arrlit_init_fits, types.c:923). Teeth: the fnmatch.ww '\\': u8
workaround cast and getopttest's 'X': u8 index-store casts are removed
and compile green. Checker-only (no e.type_ restamp): byte-id held.
This commit is contained in:
2026-06-11 20:41:20 +09:00
parent fa17459558
commit 8d2d157a58
5 changed files with 216 additions and 13 deletions

View File

@@ -123,8 +123,7 @@ fn pat_next(pat: str, pos: *i32, fl: flag) (u8 | star | question | bracket | end
*pos += 1;
return c2;
};
// #29: wwstage over-rejects the implicit flexible-rune-const narrow (harec promote_flexible accepts); explicit cast until flexible-const promotion lands — revert to bare '\\' then.
return '\\': u8;
return '\\';
};
return c;
};