Skip to content

Commit 8450182

Browse files
committed
if a binding exists in multiple usings, prefer a non-deprecated one
This removes a spurious warning if Base.X is deprecated to Mod.X, and one does `using Mod`. `X` is available from both `Base` and `Mod`, but we asked for the non-deprecated one so there should be no warning.
1 parent 9a5ea90 commit 8450182

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/module.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,10 @@ static jl_binding_t *jl_get_binding_(jl_module_t *m, jl_sym_t *var, modstack_t *
200200
(void)jl_get_binding_wr(m, var);
201201
return NULL;
202202
}
203-
owner = imp;
204-
b = tempb;
203+
if (owner == NULL || !tempb->deprecated) {
204+
owner = imp;
205+
b = tempb;
206+
}
205207
}
206208
}
207209
if (owner != NULL) {

0 commit comments

Comments
 (0)