Skip to content

Commit 4cf3975

Browse files
Remove warning from c when binding is ambiguous (#56103)
(cherry picked from commit 1438b15)
1 parent 4751c23 commit 4cf3975

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

doc/src/manual/modules.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,14 +281,14 @@ julia> module B
281281
B
282282
```
283283

284-
The statement `using .A, .B` works, but when you try to call `f`, you get a warning
284+
The statement `using .A, .B` works, but when you try to call `f`, you get an error with a hint
285285

286286
```jldoctest module_manual
287287
julia> using .A, .B
288288
289289
julia> f
290-
WARNING: both B and A export "f"; uses of it in module Main must be qualified
291290
ERROR: UndefVarError: `f` not defined in `Main`
291+
Hint: It looks like two or more modules export different bindings with this name, resulting in ambiguity. Try explicitly importing it from a particular module, or qualifying the name with the module it should come from.
292292
```
293293

294294
Here, Julia cannot decide which `f` you are referring to, so you have to make a choice. The following solutions are commonly used:

src/module.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -336,11 +336,6 @@ static jl_binding_t *using_resolve_binding(jl_module_t *m JL_PROPAGATES_ROOT, jl
336336
// the owner will still be NULL, so it can be later imported or defined
337337
tempb = jl_get_module_binding(m, var, 1);
338338
tempb->usingfailed = 1;
339-
jl_printf(JL_STDERR,
340-
"WARNING: both %s and %s export \"%s\"; uses of it in module %s must be qualified\n",
341-
jl_symbol_name(owner->name),
342-
jl_symbol_name(imp->name), jl_symbol_name(var),
343-
jl_symbol_name(m->name));
344339
}
345340
return NULL;
346341
}

0 commit comments

Comments
 (0)