Deprecation message sources

Steven Schveighoffer schveiguy at gmail.com
Wed Sep 18 15:50:16 UTC 2019


On 9/18/19 11:09 AM, H. S. Teoh wrote:
> On Wed, Sep 18, 2019 at 10:48:27AM -0400, Steven Schveighoffer via Digitalmars-d-learn wrote:
>> On 9/17/19 8:14 PM, Jonathan M Davis wrote:
> [...]
>>> I suspect that deprecation messages are being triggered simply by
>>> code trying to use Nullable in template constraints rather than just
>>> when it's actually used in proper code, but I don't know.
>>
>> I too, think that it's really the template constraints that are
>> causing so much grief. Not only that, but it's impossible to find the
>> code that's actually triggering the usage.
> 
> That's really annoying.  Why are constraints triggering deprecation
> messages?  Shouldn't it be actual usage that trigger them?

Well, if the constraint is going to change the result when the symbol is 
actually removed, I'd say yes.

For example:

foo(int);

Nullable!int x;

static if(is(typeof(foo(x))) // true before removal, false after

But of course, my call isn't going to be that, that's going to be buried 
somewhere deep in a template.

> I've also seen similar in my own projects, and it's an eyesore, esp.
> since it was Phobos code that was triggering the messages, not actually
> anything in my own code.

Yeah, I would like to see where the deprecation is being triggered in MY 
code. I don't think -de will work, because then it simply changes what 
the is-expression returns, rather than show me the full trace of what I 
was trying to instantiate.

Really annoying.

-Steve


More information about the Digitalmars-d-learn mailing list