-
Notifications
You must be signed in to change notification settings - Fork 19
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
Re-export deprecated bindings #28
Comments
So is the proposal here to have |
I think the opposite, I think the problem is right now it doesn't reexport the old names? |
The problem is that julia> module LargePackage
using Reexport
module SmallPackage
export my_new_sum
my_new_sum(A::Tuple) = reduce(+, A)
Base.@deprecate_binding my_old_sum my_new_sum
end
@reexport using .SmallPackage
end # module
Main.LargePackage
julia> using .LargePackage
julia> my_old_sum((1, 2))
ERROR: UndefVarError: my_old_sum not defined
Stacktrace:
[1] top-level scope
@ REPL[3]:1 Curiously, if we use |
That's because the expansion of |
Okay, I see the problem now: for binding in names(M; all=true, imported=true)
if Base.isexported(M, binding)
# reexport binding
end
end |
This came up recently when we renamed a few types in
ChainRules
, which uses@reexport
macro to reexport theChainRulesCore
differential types, e.g.Zero
was renamed toZeroTangent
.This broke
ReversePropagation
tests (as part of theChainRules
integration tests suite) becauseReversePropagation
only depends onChainRules
directly (rather thanChainRulesCore
), and did not understand the deprecatedZero
.The text was updated successfully, but these errors were encountered: