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).
24 lines
561 B
Plaintext
24 lines
561 B
Plaintext
//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;
|
|
};
|