Thread overview
[Issue 20916] hard to find where a deprecation comes from
Oct 09
Dlang Bot
Oct 11
Basile-z
Oct 15
Dlang Bot
June 09
https://issues.dlang.org/show_bug.cgi?id=20916

John Colvin <john.loughran.colvin@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic, industry

--
June 10
https://issues.dlang.org/show_bug.cgi?id=20916

uplink.coder@googlemail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |uplink.coder@googlemail.com

--- Comment #1 from uplink.coder@googlemail.com ---
In this case, the deprecation seems actually caused by a template-constraint
Which should evaluate the symbol in a speculative context.
We could keep track of context I guess ...

--
October 09
https://issues.dlang.org/show_bug.cgi?id=20916

Mathias LANG <pro.mathias.lang@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pro.mathias.lang@gmail.com

--- Comment #2 from Mathias LANG <pro.mathias.lang@gmail.com> ---
Example code:
```
import std.stdio;

struct Foo
{
    pure nothrow @nogc @safe:
    deprecated string toString() const { return "Hello"; }
    int value;
}

void main ()
{
    Foo f;
    writeln(f);
}
```

Currently this prints:
```
std/format.d(3921): Deprecation: function foo.Foo.toString is deprecated
std/format.d(4053): Deprecation: function foo.Foo.toString is deprecated
```

We would like it to print something similar to how template instantiation
failures are printed, that is:
```
std/format.d(4053): Deprecation: function foo.Foo.toString is deprecated
std/format.d(4430):        instantiated from here:
formatObject!(LockingTextWriter, Foo, char)
std/format.d(1875):        instantiated from here:
formatValueImpl!(LockingTextWriter, Foo, char)
std/format.d(576):        instantiated from here:
formatValue!(LockingTextWriter, Foo, char)
std/stdio.d(1565):        instantiated from here:
formattedWrite!(LockingTextWriter, char, Foo)
std/stdio.d(3927):        instantiated from here: write!(Foo, char)
foo.d(15):        instantiated from here: writeln!(Foo)
```

--
October 09
https://issues.dlang.org/show_bug.cgi?id=20916

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
@Geod24 created dlang/dmd pull request #11839 "Fix 20916 - Print trace for deprecations triggered inside templates" fixing this issue:

- Fix 20916 - Print trace for deprecations triggered inside templates

https://github.com/dlang/dmd/pull/11839

--
October 11
https://issues.dlang.org/show_bug.cgi?id=20916

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |b2.temp@gmx.com

--- Comment #4 from Basile-z <b2.temp@gmx.com> ---
*** Issue 21176 has been marked as a duplicate of this issue. ***

--
October 15
https://issues.dlang.org/show_bug.cgi?id=20916

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #11839 "Fix 20916 - Print trace for deprecations triggered inside templates" was merged into master:

- 5a86b8dcac2f2e483fbe4ce6264d1238ef6833e6 by Geod24:
  Fix 20916 - Print trace for deprecations triggered inside templates

https://github.com/dlang/dmd/pull/11839

--