D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21830 - Wrong deprecation message when non-deprecated template in static condition
Summary: Wrong deprecation message when non-deprecated template in static condition
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 16:48 UTC by Iain Buclaw
Modified: 2021-04-16 00:33 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 16:48:58 UTC
deprecated struct OldStruct { }

struct NewStruct { }

static if (1)
{
    auto getInit(T)(T t)
    if (is(T == NewStruct))
    {
        return T.init;
    }
}

deprecated("Using deprecated overload")
auto getInit(T)(T t)
if (is(T == OldStruct))
{
    return T.init;
}

unittest
{
    auto b = getInit(NewStruct()); // error here about using getInit!OldStruct
}
Comment 1 Dlang Bot 2021-04-15 17:40:39 UTC
@ibuclaw created dlang/dmd pull request #12441 "fix Issue 21830 - Wrong deprecation message when non-deprecated template in static condition" fixing this issue:

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

https://github.com/dlang/dmd/pull/12441
Comment 2 Dlang Bot 2021-04-16 00:33:15 UTC
dlang/dmd pull request #12441 "fix Issue 21830 - Wrong deprecation message when non-deprecated template in static condition" was merged into master:

- 5636fb3b592c0b85a109b2737014598bf5e448af by Iain Buclaw:
  fix Issue 21830 - Wrong deprecation message when non-deprecated template in static condition

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