From 0f0d2d2c1c3f26387af42d5150f81e9b68b38656 Mon Sep 17 00:00:00 2001 From: Hojun-Cho Date: Sat, 13 Jun 2026 00:10:59 +0900 Subject: [PATCH] wcc/ww: document the unreachable N_TARRAY destructure arm An array-typed tuple element cannot reach paramfieldsize: the checker rejects composite tuple elements (check.ww:2150, the #60 gate), pinned by test 832. The rule-7 note at the fall-through now records the proof instead of an open task. Task #39 closes as unreachable. --- selfhost/cmd/w6c/main.combined.ww | 16 +++++++++++----- selfhost/cmd/wcc/cgenstmt.ww | 16 +++++++++++----- selfhost/cmd/wwdump/main.combined.ww | 16 +++++++++++----- 3 files changed, 33 insertions(+), 15 deletions(-) diff --git a/selfhost/cmd/w6c/main.combined.ww b/selfhost/cmd/w6c/main.combined.ww index 637c6bb4..c1852346 100644 --- a/selfhost/cmd/w6c/main.combined.ww +++ b/selfhost/cmd/w6c/main.combined.ww @@ -39263,11 +39263,17 @@ fn paramfieldsize(t: *node) i32 = { let ps: i32 = primsize(nm); if (ps > 0) { return ps; }; }; - // rule-7: N_TARRAY (an array-typed tuple/struct field) is intentionally - // not sized here — deferred to task #39. No F7 repro or spec-§5-c4 - // member feeds it, so it stays on the 8B default (mis-sized, latent) - // until a consumer surfaces; the divergence is pointed at the task, not - // silent. + // rule-7: N_TARRAY (an array-typed tuple field) is intentionally not + // sized here — and PROVABLY unreachable, not merely latent (#39). + // paramfieldsize's only callers are tuple-field contexts (the N_TTUPLE + // recursion above + the cgforrange destructure sizers below), and the + // checker loud-REJECTS an array/struct/nested-tuple tuple element at + // N_TTUPLE resolution (check.ww:2150, "composite element deferred to + // task #60"; pinned both-stage by test 832_tuple_elem_overlong). So no + // tuple field can carry an N_TARRAY type — this arm cannot be reached + // until #60's inline-composite layout lands and lifts that gate. The 8B + // fall-through is correct-by-vacuity; reopen WITH #60, adding the arm + // (read t.type_.size, twin of the #53 tagged arm above). return 8; }; diff --git a/selfhost/cmd/wcc/cgenstmt.ww b/selfhost/cmd/wcc/cgenstmt.ww index bef3e0b2..cbc01023 100644 --- a/selfhost/cmd/wcc/cgenstmt.ww +++ b/selfhost/cmd/wcc/cgenstmt.ww @@ -3711,11 +3711,17 @@ fn paramfieldsize(t: *node) i32 = { let ps: i32 = primsize(nm); if (ps > 0) { return ps; }; }; - // rule-7: N_TARRAY (an array-typed tuple/struct field) is intentionally - // not sized here — deferred to task #39. No F7 repro or spec-§5-c4 - // member feeds it, so it stays on the 8B default (mis-sized, latent) - // until a consumer surfaces; the divergence is pointed at the task, not - // silent. + // rule-7: N_TARRAY (an array-typed tuple field) is intentionally not + // sized here — and PROVABLY unreachable, not merely latent (#39). + // paramfieldsize's only callers are tuple-field contexts (the N_TTUPLE + // recursion above + the cgforrange destructure sizers below), and the + // checker loud-REJECTS an array/struct/nested-tuple tuple element at + // N_TTUPLE resolution (check.ww:2150, "composite element deferred to + // task #60"; pinned both-stage by test 832_tuple_elem_overlong). So no + // tuple field can carry an N_TARRAY type — this arm cannot be reached + // until #60's inline-composite layout lands and lifts that gate. The 8B + // fall-through is correct-by-vacuity; reopen WITH #60, adding the arm + // (read t.type_.size, twin of the #53 tagged arm above). return 8; }; diff --git a/selfhost/cmd/wwdump/main.combined.ww b/selfhost/cmd/wwdump/main.combined.ww index ee0faf89..91bcb5ce 100644 --- a/selfhost/cmd/wwdump/main.combined.ww +++ b/selfhost/cmd/wwdump/main.combined.ww @@ -39263,11 +39263,17 @@ fn paramfieldsize(t: *node) i32 = { let ps: i32 = primsize(nm); if (ps > 0) { return ps; }; }; - // rule-7: N_TARRAY (an array-typed tuple/struct field) is intentionally - // not sized here — deferred to task #39. No F7 repro or spec-§5-c4 - // member feeds it, so it stays on the 8B default (mis-sized, latent) - // until a consumer surfaces; the divergence is pointed at the task, not - // silent. + // rule-7: N_TARRAY (an array-typed tuple field) is intentionally not + // sized here — and PROVABLY unreachable, not merely latent (#39). + // paramfieldsize's only callers are tuple-field contexts (the N_TTUPLE + // recursion above + the cgforrange destructure sizers below), and the + // checker loud-REJECTS an array/struct/nested-tuple tuple element at + // N_TTUPLE resolution (check.ww:2150, "composite element deferred to + // task #60"; pinned both-stage by test 832_tuple_elem_overlong). So no + // tuple field can carry an N_TARRAY type — this arm cannot be reached + // until #60's inline-composite layout lands and lifts that gate. The 8B + // fall-through is correct-by-vacuity; reopen WITH #60, adding the arm + // (read t.type_.size, twin of the #53 tagged arm above). return 8; };