[Issue 21830] New: Wrong deprecation message when non-deprecated function in static condition

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 15 16:48:58 UTC 2021


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

          Issue ID: 21830
           Summary: Wrong deprecation message when non-deprecated function
                    in static condition
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ibuclaw at gdcproject.org

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
}

--


More information about the Digitalmars-d-bugs mailing list