Thread overview
Deprecation message from phobos compiling a vibe.d app.
Jan 30, 2020
drug
Jan 30, 2020
MoonlightSentinel
January 30, 2020
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.
January 30, 2020
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
January 30, 2020
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