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

Fix Issue 20840 - No deprecation for template from deprecated selecti… #11158

Merged
merged 1 commit into from
May 23, 2020

Conversation

MoonlightSentinel
Copy link
Contributor

…ve import

Selective imports are lowered to an AliasDeclarations which were discarded when
resolving the actual TemplateDeclaration. So make sure to check the AD as well.

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @MoonlightSentinel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
20840 normal No deprecation when using template from deprecated selective import

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#11158"

@schveiguy
Copy link
Member

With this, can you deprecate a template? The test case doesn't include a template that is directly deprecated. This does look like it should provide a way forward though for the problem at hand.

@MoonlightSentinel
Copy link
Contributor Author

MoonlightSentinel commented May 18, 2020

You mean a template declaration or an instance?

@schveiguy
Copy link
Member

schveiguy commented May 18, 2020

My original plan was to put in a deprecated AliasSeq in std.math, but even deprecating a template declaration doesn't do anything!

e.g.:

deprecated alias AliasSeq(V...) = V;

alias x = AliasSeq!(1, 2, 3); // no message

@MoonlightSentinel
Copy link
Contributor Author

MoonlightSentinel commented May 18, 2020

I see. That issue needs to be fixed as well but is unrelated to the current bug.

EDIT:
Because this concerns non-deprecated template declarations.

Copy link
Member

@wilzbach wilzbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@MoonlightSentinel
Copy link
Contributor Author

Changed to only check AliasDeclarations because the eager check print's a wrong error message for some deprecated templates (WIP)

@Geod24
Copy link
Member

Geod24 commented May 19, 2020

Does it also work with __traits(isDeprecated) ? Asking because https://issues.dlang.org/show_bug.cgi?id=20221

@MoonlightSentinel
Copy link
Contributor Author

MoonlightSentinel commented May 19, 2020

No, but it probably will once that bug is fixed.

…ve import

Selective imports are lowered to an AliasDeclarations which were discarded when
resolving the actual TemplateDeclaration. So make sure to check the AD as well.
@thewilsonator thewilsonator merged commit a0af9fa into dlang:master May 23, 2020
@MoonlightSentinel MoonlightSentinel deleted the depr-import branch May 23, 2020 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants