check: stamp SK_TYPE value idents with the per-decl NAMED

A TYPE name used as a VALUE (an error-singleton `return too_long;`)
stamped the flattened BODY type, so structurally identical !void
singletons in one union were indistinguishable and flatvariantidxt
loud-rejected the ambiguity — the real cause of the lib/path wwstage
reject (the pinned #120/#29 global-slice-const blame was stale; that
family had drained). The N_IDENT arm resolves through a synthesized
TNAME (the #66 N_STRUCTLIT precedent); the module-qualified N_DOT twin
reads the sym's cached NAMED. Graduates the path M_WWREJECT pin (#142).
This commit is contained in:
2026-08-08 01:00:03 +09:00
parent 125f626697
commit c18005d833
4 changed files with 69 additions and 11 deletions

View File

@@ -0,0 +1,23 @@
//ww:run-exit 42
// #142: a VALUE use of an error-singleton type name whose union has
// structurally identical siblings. The pre-fix wwstage stamped the
// flattened BODY type (!void), so flatvariantidxt could not pick a
// variant and loud-rejected; the per-decl NAMED stamp discriminates.
// Exit 42 proves the SECOND variant is selected, not the first.
package main;
type a = !void;
type b = !void;
type err = !(a | b);
fn f() err = {
return b;
};
fn main() i32 = {
match (f()) {
case a => { return 41; };
case b => { return 42; };
};
return 9;
};