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

InteractiveUtils.jl: fixes issue where subtypes resolves bindings and causes deprecation warnings #56306

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dgleich
Copy link

@dgleich dgleich commented Oct 23, 2024

The current version of subtypes will throw deprecation errors even if no one is using the deprecated bindings.

A similar bug was fixed in Aqua.jl - https://github.com/JuliaTesting/Aqua.jl/pull/89/files

See discussion here:

This adds the isbindingresolved test to the subtypes function to avoid throwing deprecation warnings. It also adds a test to check that this doesn't happen.


On the current master branch (before the fix), the added test shows:

WARNING: using deprecated binding InternalModule.MyOldType in OuterModule.
, use MyType instead.
Subtypes and deprecations: Test Failed at /home/dgleich/devextern/julia/usr/share/julia/stdlib/v1.12/Test/src/Test.jl:932
  Expression: isempty(stderr_content)
   Evaluated: isempty("WARNING: using deprecated binding InternalModule.MyOldType in OuterModule.\n, use MyType instead.\n")
Test Summary:             | Fail  Total  Time
Subtypes and deprecations |    1      1  2.8s
ERROR: LoadError: Some tests did not pass: 0 passed, 1 failed, 0 errored, 0 broken.
in expression starting at /home/dgleich/devextern/julia/stdlib/InteractiveUtils/test/runtests.jl:841
ERROR: Package InteractiveUtils errored during testing

Using the results of this pull request:

@test_nowarn subtypes(Integer);

passes without error. The other tests pass too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant