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

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-01-17T08:08:36Z
Last change time
2021-04-16T03:08:42Z
Keywords
pull
Assigned to
No Owner
Creator
Seb

Comments

Comment #0 by greensunny12 — 2018-01-17T08:08:36Z
--- 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 by greeenify — 2018-07-02T22:12:44Z
Fixed since a while, but somehow this wasn't auto-closed. https://run.dlang.io/is/IM7H7c
Comment #2 by greensunny12 — 2018-08-15T10:27:29Z
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 by dlang-bot — 2021-04-15T14:17:44Z
@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 by dlang-bot — 2021-04-16T03:08:42Z
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