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
2 changes: 1 addition & 1 deletion src/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ static jl_binding_t *jl_get_binding_(jl_module_t *m, jl_sym_t *var, modstack_t *
// do a full import to prevent the result of this lookup
// from changing, for example if this var is assigned to
// later.
module_import_(m, b->owner, var, var, 0);
module_import_(m, b->owner, b->name, var, 0);
return b;
}
return NULL;
Expand Down
9 changes: 9 additions & 0 deletions test/syntax.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2531,7 +2531,10 @@ end

module Mod2
import ..Mod.x as x_from_mod
import ..Mod.x as x_from_mod2
const y = 2

export x_from_mod2
end

import .Mod: x as x2
Expand Down Expand Up @@ -2576,6 +2579,12 @@ import .Mod2.x_from_mod

@test @isdefined(x_from_mod)
@test x_from_mod == Mod.x

using .Mod2

@test_nowarn @eval x_from_mod2
@test @isdefined(x_from_mod2)
@test x_from_mod2 == x_from_mod == Mod.x
end

import .TestImportAs.Mod2 as M2
Expand Down