Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,11 @@ JL_DLLEXPORT jl_binding_t *jl_get_binding_wr(jl_module_t *m JL_PROPAGATES_ROOT,
if (decode_restriction_kind(pku) != BINDING_KIND_DECLARED) {
check_safe_newbinding(m, var);
if (!alloc)
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));
jl_errorf("Global %s.%s does not exist and cannot be assigned.\n"
"Note: Julia 1.9 and 1.10 inadvertently omitted this error check (#56933).\n"
"Hint: Declare it using `global %s` inside `%s` before attempting assignment.",
jl_symbol_name(m->name), jl_symbol_name(var),
jl_symbol_name(var), jl_symbol_name(m->name));
}
jl_ptr_kind_union_t new_pku = encode_restriction((jl_value_t*)jl_any_type, BINDING_KIND_GLOBAL);
if (!jl_atomic_cmpswap(&bpart->restriction, &pku, new_pku))
Expand Down
Loading