[Issue 21831] New: Wrong deprecation message in template parameters before evaluating constraints

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 15 17:19:21 UTC 2021


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

          Issue ID: 21831
           Summary: Wrong deprecation message in template parameters
                    before evaluating constraints
           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 { }

auto foo(T)(T t)    // error: struct `OldStruct` is deprecated
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(OldStruct()); // instantiated from here
}

--


More information about the Digitalmars-d-bugs mailing list