Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fix issue 9289: Show deprecations even when gag is on #1581

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

Deprecations warnings should be shown everywhere, because if you are
using any deprecated features (even in traits or static ifs) you
should be noticed.

This pull request will pass the test suite only when pull #1579 is merged.

I can update this if pull #1579 doesn't get accepted but this one does.

@leandro-lucarella-sociomantic leandro-lucarella-sociomantic Fix issue 9289: Show deprecations even when gag is on
Deprecations warnings should be shown everywhere, because if you are
using *any* deprecated features (even in traits or static ifs) you
should be noticed.
70f9378

OK, looks like pulling #1579 is not strictly necessary but the added testcase will have no effect in this case.

Contributor

don-clugston-sociomantic commented Jan 30, 2013

Although this idea is appealing in some circumstances (specifically, when you have just upgraded from one compiler version to another), in others it is NOT what you want, and it breaks existing code.
Using your test case, suppose you have the code:

auto  foo(P)(P p){
    static if ( is(typeof( *p)) {
        return *p;
    } else static if (is(typeof(p[0])) {
       return p[0];
    } else static assert(0, "unsupported");
}

Currently, if -d is not specified, passing an array to this will work correctly: the second return will be used. If -d is specified, it will also work correctly: the first return will be used. With your patch, the code will not work at all.
If I have a codebase where I never even use -d, this pull request is suddenly making that obscure, stupid, long-deprecated feature have an impact on my code!

I think we just have to accept that having deprecated features still accepted in the language is a major annoyance. I'm not sure that there is a perfect solution. We should really try to get rid of them.

@donc Please, try to make comments only to the submitted patch (code) here, not the solution itself. The rationale behind this patch is in the bugzilla issue, if you see problems with the solution is better to reply there, otherwise the conversation will be lost if this pull request is closed and need more discussion about the solution to pick.

I'll copy your message there and reply there too:
http://d.puremagic.com/issues/show_bug.cgi?id=9289

Looks like this pull request doesn't really fix the problem...

@leandro-lucarella-sociomantic leandro-lucarella-sociomantic deleted the leandro-lucarella-sociomantic:depregag branch Oct 16, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment