D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21832 - Wrong deprecation message when importing non-deprecated template in static condition
Summary: Wrong deprecation message when importing non-deprecated template in static co...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2021-04-15 21:55 UTC by Iain Buclaw
Modified: 2021-04-16 01:50 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Iain Buclaw 2021-04-15 21:55:24 UTC
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
}
---
Comment 1 Iain Buclaw 2021-04-15 22:09:40 UTC
Correction on test:

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
}
Comment 2 Dlang Bot 2021-04-15 23:07:11 UTC
@ibuclaw created dlang/dmd pull request #12442 "fix Issue 21832 - Wrong deprecation message when importing non-deprecated template in static condition" fixing this issue:

- fix Issue 21832 - Wrong deprecation message when importing non-deprecated template in static condition

https://github.com/dlang/dmd/pull/12442
Comment 3 Dlang Bot 2021-04-16 01:50:20 UTC
dlang/dmd pull request #12442 "fix Issue 21832 - Wrong deprecation message when importing non-deprecated template in static condition" was merged into master:

- d029cc4c9fa06d96470c933da2d4c33614fa3c18 by Iain Buclaw:
  fix Issue 21832 - Wrong deprecation message when importing non-deprecated template in static condition

https://github.com/dlang/dmd/pull/12442