Bug 17193 – selective imports -> deprecation warnings even if symbol is not used

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-02-17T06:01:35Z
Last change time
2021-08-13T07:22:32Z
Keywords
diagnostic, industry, rejects-valid
Assigned to
No Owner
Creator
Seb
See also
https://issues.dlang.org/show_bug.cgi?id=16577

Comments

Comment #0 by greeenify — 2017-02-17T06:01:35Z
Consider this simple example with foo.d and bar.d: foo.d: ``` import core.stdc.stdio; deprecated("To be removed November 2017. Please use std.utf.encode instead.") void toUTF8(return out char[4] buf, dchar c) { pragma(msg, "bar CTFE"); printf("bar()"); } void toUTF8(S)(S s) { pragma(msg, "foo CTFE"); printf("foo()"); } ``` bar.d: ``` void main(string[] args) { import foo : toUTF8; toUTF8("aaa"d); } ``` > rdmd bar.d foo.d bar.d(4): Deprecation: function foo.toUTF8 is deprecated - To be removed November 2017. Please use std.utf.encode instead. bar.d(4): Deprecation: function foo.toUTF8 is deprecated - To be removed November 2017. Please use std.utf.encode instead. foo CTFE bar CTFE foo() bar.d (working) ``` void main(string[] args) { import foo; toUTF8("aaa"d); } ```
Comment #1 by dlang-bugzilla — 2017-07-12T19:17:07Z
Same with a fully qualified import (`static import foo; foo.toUTF8("aoeu");` in your example).
Comment #2 by johanengelen — 2017-08-16T18:30:04Z
*** Issue 17757 has been marked as a duplicate of this issue. ***
Comment #3 by b2.temp — 2017-08-19T00:23:34Z
committer, fix also 16577, it's so closed.
Comment #4 by razvan.nitu1305 — 2021-08-13T07:22:32Z
Cannot reproduce with git HEAD. Closing as fixed.