D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 18251 - deprecate + transition=complex shouldn't look at functions with non-matching if constraints
Summary: deprecate + transition=complex shouldn't look at functions with non-matching ...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2018-01-17 08:08 UTC by Seb
Modified: 2021-04-16 03:08 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 Seb 2018-01-17 08:08:36 UTC
---
auto foo(T)(T t)
if (!__traits(isDeprecated, T))
{
    return T.init;
}

deprecated
auto foo(T)(T t)
if (__traits(isDeprecated, T))
{
    return T.init;
}

deprecated unittest
{
    auto b = foo(2 + 2i);
}
---


This shouldn't trigger a deprecation on line 1:

> dmd -unittest -c -o- -transition=complex foo.d

foo.d(1): Deprecation: use of complex type cdouble is deprecated, use std.complex.Complex!(double) instead
foo.d(8): Deprecation: use of complex type cdouble is deprecated, use std.complex.Complex!(double) instead
Comment 1 Seb 2018-07-02 22:12:44 UTC
Fixed since a while, but somehow this wasn't auto-closed.

https://run.dlang.io/is/IM7H7c
Comment 2 Seb 2018-08-15 10:27:29 UTC
Looks like this was never fully fixed, but the earlier run.dlang.io example simply forgot the `-transition=complex`:

https://run.dlang.io/is/S9Us4A
Comment 3 Dlang Bot 2021-04-15 14:17:44 UTC
@ibuclaw created dlang/dmd pull request #12435 "fix Issue 18251 - deprecate + transition=complex shouldn't look at functions with non-matching if constraints" fixing this issue:

- fix Issue 18251 - deprecate + transition=complex shouldn't look at functions with non-matching if constraints

https://github.com/dlang/dmd/pull/12435
Comment 4 Dlang Bot 2021-04-16 03:08:42 UTC
dlang/dmd pull request #12435 "fix Issue 18251 - deprecate + transition=complex shouldn't look at functions with non-matching if constraints" was merged into master:

- 5ae6003839b175249bcaa1159b8aa8a4b3bcd577 by Iain Buclaw:
  fix Issue 18251 - deprecate + transition=complex shouldn't look at functions with non-matching if constraints

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