[Issue 21832] New: Wrong deprecation message when importing non-deprecated template in static condition

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 15 21:55:24 UTC 2021


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 at puremagic.com
          Reporter: ibuclaw at 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
}
---

--


More information about the Digitalmars-d-bugs mailing list