Bug 16577 – A selective import on a symbol that has overloads leads to duplicate deprecation messages

Status
RESOLVED
Resolution
WORKSFORME
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-10-02T20:04:09Z
Last change time
2022-02-07T19:20:48Z
Assigned to
No Owner
Creator
Basile-z
See also
https://issues.dlang.org/show_bug.cgi?id=17193

Comments

Comment #0 by b2.temp — 2016-10-02T20:04:09Z
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.
Comment #1 by greeenify — 2016-12-27T11:29:36Z
Trying to deprecate std.typetuple led to an armada of deprecation messages: https://ci.dawg.eu/job/projects/458/REPO=rejectedsoftware%2Fvibe.d/consoleFull So I guess there should be some mechanism in dmd to deduplicate deprecation messages (thus I changed the title accordingly)
Comment #2 by code — 2017-02-08T20:39:39Z
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; } ---