-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Milestone
Description
Consider the following example:
julia> module ModA
const x = 1
module ModB
const y = 3
const x = 2
end
end;
julia> import Main.ModA: ModB.y, x
julia> x
2
julia> x === Main.ModA.ModB.x
true
julia> x === Main.ModA.x
falseImporting ModB.y first changes some state and causes x to be imported from ModB instead of ModA directly.
Switching to Main.ModA: x, ModB.y fixes the import.
This even happens when ModB.x doesn't exist:
julia> module ModA
const x = 1
module ModB
const y = 3
end
end;
julia> import Main.ModA: ModB.y, x
WARNING: Imported binding ModB.x was undeclared at import time during import to Main.This does not happen on 1.11 or 1.12 and has appeared with #57965 (@xal-0).
It does not happen on the previous commit 0b40de7:
julia> module ModA
const x = 1
module ModB
const y = 3
const x = 2
end
end;
julia> import Main.ModA: ModB.y, x
julia> x
1Metadata
Metadata
Assignees
Labels
No labels