-
-
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
Allow using LongPackageName as LPN
and change export conventions.
#52821
Open
LilithHafner
wants to merge
17
commits into
master
Choose a base branch
from
lh/using-as
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…icitly load module name on `using Mod` or `using Mod as M`
LilithHafner
added
needs tests
Unit tests are required for this change
minor change
Marginal behavior change acceptable for a minor release
needs pkgeval
Tests for all registered packages should be run with this change
labels
Jan 8, 2024
I'm open to more test cases, this is surprisingly finicky. |
LilithHafner
added
needs docs
Documentation for this change is required
and removed
needs news
A NEWS entry is required for this change
labels
Jan 8, 2024
Dropping this link here as a TODO once we update JuliaSyntax and unblock this PR: review this discord thread and consider if/how the changes here impact that situation |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
minor change
Marginal behavior change acceptable for a minor release
needs docs
Documentation for this change is required
needs pkgeval
Tests for all registered packages should be run with this change
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before:
After:
This PR is implemented by
using
(i.e. creates an explicit imported const binding)using Mod as M
, add Mod to the list of "used" modules and create an explicit imported binding M => Mod.(non)breaking change 1
Base.isexported(Statistics, :Statistics)
will now return false (in Julia <=1.10 Base.isexported was not part of the public API)Base.ispublic(Statistics, :Statistics)
will now return false (in Julia <=1.10 Base.public was not defined)Breaking change 2
names(Mod)
currently no longer includes :Mod, I'd like to stop implicitly marking the module itself as public because I don't think Statistics.Statistics is something that should be public by default. Specifically, I think that in the package M1,The code
M1.API.M2.f()
depends on internals (the name of the module M2, which was never marked public)Breaking change 3
The code
now throws on
because the using statement tries and fails to create an explicit binding. This is a code pattern that is currently in use in Pkg.jl, but I do think it's a bit of an antipattern, and this PR creates a great workaround. However, maybe we should downgrade that into a warning.
Implements #52784 (resolves #52784)
Fixes #52817
Is a superset of and therefore closes #52810 (NFC)
Depends on JuliaLang/JuliaSyntax.jl#406
Depends on JuliaLang/Pkg.jl#3750