www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21832] New: Wrong deprecation message when importing

https://issues.dlang.org/show_bug.cgi?id=21832

          Issue ID: 21832
           Summary: Wrong deprecation message when importing
                    non-deprecated template in static condition
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ibuclaw gdcproject.org

Similar to issue 21830, but uses selective imports.

---
module mod;
static if(1)
{
    int fun()(int a)
    {
        return a;
    }
}

deprecated double fun()(double a)
{
    return a;
}
---
module main;
int inst(T)(T x)
{
    import selective : fun; // template 'fun' is deprecated
    return fun(x);
}

int main()
{
    return inst(0); // instantiated from here
}
---

--
Apr 15 2021