You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A module's own global is shadowed by a bare variant name of an enum an imported module declares #3068
// flagsmod.w
pub enum Flags:
BEFORE
AFTER
// main.w
use flagsmod
let AFTER = "expected text"
fn main:
print(f"{AFTER}")
BUG: a `&str` runtime argument is not a str value (LLVM type kind 8) [src/CodegenDispatch.w:18342 Codegen.str_view_arg]
with check main.w --dump-typed types the global as let AFTER: str, but the use resolves to Flags.AFTER (an integer), in an f-string, in assert, and as an assert_eq argument (there it printed != "16384" when the enum was FnFlags). A pub const AFTER: i32 in the imported module does not shadow the global; only an enum's bare variant name does (SemaDecl.w registers every variant under its bare name in variant_lookup, lines ~1354 and ~1469, and the identifier path consults it ahead of the module's own declaration). §18.2 / D70: a module's own declaration beats anything an import brings in. Found 2026-11-08 writing test/internals/ceremony_fix_test.w with globals named BEFORE and AFTER while importing the compiler's modules (FnFlags.AFTER = 16384).
Activity
#3068: a module's global named like an imported enum's bare variant i…
#3061 slice 1: with fix-ceremony; #3068: a global named like an impor…