www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18251] New: deprecate + transition=complex shouldn't look at

https://issues.dlang.org/show_bug.cgi?id=18251

          Issue ID: 18251
           Summary: deprecate + transition=complex shouldn't look at
                    functions with non-matching if constraints
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: greensunny12 gmail.com

---
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 --
Jan 17