-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
force a require if binding with different uuid is present. #21537
Conversation
This works around `Base.Iterators` shadowing `Iterators`, as noted in #21492.
This is going to cause warnings and break inference:
|
`isdefined` will immediatly resolve the binding. Since we are only trying to skip the path lookup the weaker version `isbindingresolved` is enough. `isbindingresolved` is also used for this purpose in `read_verify_mod_list` in `src/dump.c`.
Thanks! Now it also makes sense why #21492 would trigger this. I think we should drop the first commit here? |
I think that first commit is actually somewhat more consistent: julia> Iterators
Base.Iterators
julia> using Iterators
WARNING: imported binding for Iterators overwritten in module Main Although we should only trigger that if julia> module Iterators end |
I am not sure I understand the last part of your comment. Do you mean that this: julia> module Iterators end
Iterators
julia> using Compose
WARNING: replacing module Iterators. Should fail instead of replacing the module? How do I best differentiate between a latent binding and real one? |
There is of course the option of doing the uuid check in |
The only long term solution to this is to not use the same module for the REPL and the package root, but that can't be done for 0.6. In the interim, REPL work should avoid using or defining things named |
With the newest commit (after precompiling compose)
which is in my opinion the right error for this situation. |
There is another edge-case that I will take a look at later:
|
I think that last one is from falling through when finding that the Base module is incompatible (trying to replace it), rather than returning a failure.
The primary goal is to replicate the logic of
(sadly though, in this example case, it's also still broken and unable to actually use
|
Ok I split out 2a61131 into a seperate PR since everything in here can wait and needs more time. |
This works around
Base.Iterators
shadowingIterators
, as noted in #21492.I don't quite understand why that didn't happen before #21492, but that fixes it for me locally.
@fredrikekre and @bjarthur could you try this locally?