[Issue 17193] New: selective imports -> deprecation warnings even if symbol is not used
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Thu Feb 16 22:01:35 PST 2017
https://issues.dlang.org/show_bug.cgi?id=17193
Issue ID: 17193
Summary: selective imports -> deprecation warnings even if
symbol is not used
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: greeenify at gmail.com
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);
}
```
--
More information about the Digitalmars-d-bugs
mailing list