Taking the case of std.json.toJSON:
void main()
{
import std.json: toJSON, JSONValue;
JSONValue v;
auto str = toJSON(v);
}
the deprecation message appears two times for the selective import but we only use the right overload once.
Would be fairly simple to deduplicate deprecation messages when triggering them, not sure about the memory requirements (prolly not much) or other strategies to avoid emitting the same message.
We should only deduplicate messages occuring at the same source location, so that it remains possible to fix all of them in one go.
Comment #3 by b2.temp — 2017-11-15T18:10:28Z
New test case since the JSON thing is gonna be removed from 2.0.78
---
module test16577;
deprecated void foo(int*){}
void foo(ref int){}
void main()
{
import test16577 : foo;
}
---