Skip to content
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

allow re-importing the same module from different owners #28197

Merged
merged 2 commits into from
Jul 23, 2018
Merged

Conversation

stevengj
Copy link
Member

Fixes #28190.

@stevengj stevengj requested review from JeffBezanson and vtjnash July 19, 2018 20:26
@ararslan ararslan added modules needs tests Unit tests are required for this change labels Jul 19, 2018
@vtjnash
Copy link
Member

vtjnash commented Jul 19, 2018

If it works, it seems like it should be correct. But maybe should also test the ->deprecated flag, and see if we can clear that? (hopefully making is possible to type Profile; using Profile, although the error message that prints currently is different)

@stevengj
Copy link
Member Author

Profile; using Profile works for me with no error (but a depwarn for the first statement), so I'm not sure what checking the deprecated flag would accomplish here?

@stevengj stevengj removed the needs tests Unit tests are required for this change label Jul 19, 2018
@vtjnash
Copy link
Member

vtjnash commented Jul 19, 2018

I get:

julia> Profile; using Profile
WARNING: Base.Profile is deprecated, run `using Profile` instead
 in module Main
ERROR: importing Profile into Main conflicts with an existing identifier

But then every subsequent usage still gives:

julia> Profile 
WARNING: Base.Profile is deprecated, run `using Profile` instead
 in module Main
Profile

@stevengj
Copy link
Member Author

With this PR?

@vtjnash
Copy link
Member

vtjnash commented Jul 19, 2018

No, before the PR. Does this fix it?

@stevengj
Copy link
Member Author

stevengj commented Jul 20, 2018

@vtjnash, I now get

julia> Profile
WARNING: Base.Profile is deprecated, run `using Profile` instead
 in module Main
Profile

julia> using Profile

julia> Profile
WARNING: Base.Profile is deprecated, run `using Profile` instead
 in module Main
Profile

i.e. it doesn't give an error any more, but it doesn't clear the deprecated flag. I'm not certain under what conditions on import it would be correct to clear it, though.

@stevengj
Copy link
Member Author

I'll go ahead and merge this as it seems uncontroversial … additional changes to clear the deprecation flag can go into a separate PR.

@stevengj stevengj merged commit e6f5098 into master Jul 23, 2018
@stevengj stevengj deleted the sgj/import branch July 23, 2018 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants