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 }
@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
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