www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17193] New: selective imports -> deprecation warnings even if

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 puremagic.com
          Reporter: greeenify 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); } ``` --
Feb 16 2017