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
extern var resolves an untyped owner global in another module but calls a typed one 'not visible' (§18, D100) #2335
Spec: D100 (no pub = package-wide), §16 extern var, #113.
Repro (three files in one directory, as test/behavior/issue113_extern_var_*.w):
owner.w
var issue113_shared_counter: i32 = 41
ref.w
extern var issue113_shared_counter: i32
pub fn issue113_read_shared() -> i32: issue113_shared_counter
main.w
use issue113_extern_var_owner
use issue113_extern_var_ref
fn main:
assert(issue113_read_shared() == 41)
print("ok")
Expected: the same result whether the owner's global is typed or not. The untyped owner (var issue113_shared_counter = 41) merges with the extern var (the #113 regression test).
Actual (installed compiler and D114 stage1 alike), with the owner typed:
error: symbol 'issue113_shared_counter' is not visible from this module
--> issue113_extern_var_ref.w:7:5
The typed and untyped owners take different resolution paths (the owner fixture's comment names "the frontend's extern-var decl filter"). One of the two answers is wrong for a package-wide global. Found during the D114 sweep (#2327); not caused by it.
Triage 2026-10-25, with v0.15.3.0 (main a261b65): reproduced with a typed owner.
$ cat issue113_extern_var_owner.w
var issue113_shared_counter: i32 = 41
$ cat issue113_extern_var_ref.w
extern var issue113_shared_counter: i32
pub fn issue113_read_shared() -> i32: issue113_shared_counter
$ with run main.w
error: symbol 'issue113_shared_counter' is not visible from this module
--> issue113_extern_var_ref.w:2:39
With the owner untyped (var issue113_shared_counter = 41) the same program now stops on a different, correct error: the literal defaults to isize (D114), and returning it as i32 needs a cast.
post-release: extern var naming a With global in another module is rare, and D100 already makes a non-pub global visible package-wide.
Activity
D114: behavior fixtures name the i32 their literal locals feed
D114: isize is the target's size width — literal default, len family,…
ehartford commentedon Oct 25, 2026
Triage 2026-10-25,
with v0.15.3.0(main a261b65): reproduced with a typed owner.With the owner untyped (
var issue113_shared_counter = 41) the same program now stops on a different, correct error: the literal defaults toisize(D114), and returning it asi32needs a cast.post-release:
extern varnaming a With global in another module is rare, and D100 already makes a non-pubglobal visible package-wide.Pre-release fixes: std len casts, no host sample, AEAD (#1054), races (…