www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Deprecation message from phobos compiling a vibe.d app.

reply Martin Tschierschke <mt smartdolphin.de> writes:
When building my small vibe.d app I am getting this messages 
twice:

/usr/include/dmd/phobos/std/range/primitives.d(174,38): 
Deprecation: alias byKeyValue this is deprecated - Iterate over 
.byKeyValue instead.
/usr/include/dmd/phobos/std/range/primitives.d(176,27): 
Deprecation: alias byKeyValue this is deprecated - Iterate over 
.byKeyValue instead.
/usr/include/dmd/phobos/std/range/primitives.d(174,38): 
Deprecation: alias byKeyValue this is deprecated - Iterate over 
.byKeyValue instead.
/usr/include/dmd/phobos/std/range/primitives.d(176,27): 
Deprecation: alias byKeyValue this is deprecated - Iterate over 
.byKeyValue instead.

Unfortunately I don't know what is triggering this and what to do 
about.
The build is working, so it is more a question of elegance.
Jan 30 2020
parent reply drug <drug2004 bk.ru> writes:
On 1/30/20 2:50 PM, Martin Tschierschke wrote:
 When building my small vibe.d app I am getting this messages twice:
 
 /usr/include/dmd/phobos/std/range/primitives.d(174,38): Deprecation: 
 alias byKeyValue this is deprecated - Iterate over .byKeyValue instead.
 /usr/include/dmd/phobos/std/range/primitives.d(176,27): Deprecation: 
 alias byKeyValue this is deprecated - Iterate over .byKeyValue instead.
 /usr/include/dmd/phobos/std/range/primitives.d(174,38): Deprecation: 
 alias byKeyValue this is deprecated - Iterate over .byKeyValue instead.
 /usr/include/dmd/phobos/std/range/primitives.d(176,27): Deprecation: 
 alias byKeyValue this is deprecated - Iterate over .byKeyValue instead.
 
 Unfortunately I don't know what is triggering this and what to do about.
 The build is working, so it is more a question of elegance.
That's probably triggered by some constraints. I had the issue like this with Nullable: https://github.com/dlang/phobos/pull/7324
Jan 30 2020
parent MoonlightSentinel <moonlightsentinel disroot.org> writes:
On Thursday, 30 January 2020 at 13:05:05 UTC, drug wrote:
 That's probably triggered by some constraints. I had the issue 
 like this with Nullable: 
 https://github.com/dlang/phobos/pull/7324
The core problem here stems from the fact that templates are always instantiated in the scope of the template declaration [1]. Hence dmd instantiates some template using a deprecated symbol in a non-deprecated scope and issues these warnings. I'm currently working on a PR [2] to resolve this issue but still have to fix some issues when dealing with overloaded symbols as template alias parameters. [1] https://dlang.org/spec/template.html#instantiation_scope [2] https://github.com/dlang/dmd/pull/10677
Jan 30 2020