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:
23
test/wcc/data/r142_singleton_value_named/case.ww
Normal file
23
test/wcc/data/r142_singleton_value_named/case.ww
Normal 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;
|
||||
};
|
||||
Reference in New Issue
Block a user