Skip to content

Commit 7ad0f21

Browse files
committed
Add "mea culpa" to foreign module assignment error.
As requested in #56933, acknowledge that this error was missing in Julia 1.9 and 1.10 and provide a reference to the issue so that people have an easier starting point.
1 parent d848e2e commit 7ad0f21

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/module.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,9 @@ JL_DLLEXPORT jl_binding_t *jl_get_binding_wr(jl_module_t *m JL_PROPAGATES_ROOT,
290290
if (decode_restriction_kind(pku) != BINDING_KIND_DECLARED) {
291291
check_safe_newbinding(m, var);
292292
if (!alloc)
293-
jl_errorf("Global %s.%s does not exist and cannot be assigned. Declare it using `global` before attempting assignment.", jl_symbol_name(m->name), jl_symbol_name(var));
293+
jl_errorf("Global %s.%s does not exist and cannot be assigned.\n"
294+
"Note: Julia 1.9 and 1.10 inadvertently omitted this error check (#56933).\n"
295+
"Hint: Declare it using `global` before attempting assignment.", jl_symbol_name(m->name), jl_symbol_name(var));
294296
}
295297
jl_ptr_kind_union_t new_pku = encode_restriction((jl_value_t*)jl_any_type, BINDING_KIND_GLOBAL);
296298
if (!jl_atomic_cmpswap(&bpart->restriction, &pku, new_pku))

0 commit comments

Comments
 (0)