Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions doc/src/manual/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,14 @@ julia> module B
B
```

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

```jldoctest module_manual
julia> using .A, .B

julia> f
WARNING: both B and A export "f"; uses of it in module Main must be qualified
ERROR: UndefVarError: `f` not defined in `Main`
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.
```

Here, Julia cannot decide which `f` you are referring to, so you have to make a choice. The following solutions are commonly used:
Expand Down
5 changes: 0 additions & 5 deletions src/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,6 @@ static jl_binding_t *using_resolve_binding(jl_module_t *m JL_PROPAGATES_ROOT, jl
tempb = jl_get_module_binding(m, var, 1);
tempbpart = jl_get_binding_partition(tempb, jl_current_task->world_age);
jl_atomic_store_release(&tempbpart->restriction, encode_restriction(NULL, BINDING_KIND_FAILED));
jl_printf(JL_STDERR,
"WARNING: both %s and %s export \"%s\"; uses of it in module %s must be qualified\n",
jl_symbol_name(owner->name),
jl_symbol_name(imp->name), jl_symbol_name(var),
jl_symbol_name(m->name));
}
return NULL;
}
Expand Down