[Issue 18430] New: isSame is wrong for non global lambdas

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Feb 13 04:00:37 UTC 2018


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

          Issue ID: 18430
           Summary: isSame is wrong for non global lambdas
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ilyayaroshenko at gmail.com

template Alias(alias a)
{
    alias Alias = a;
}

auto foo()
{
    auto scale = 4;
    alias edentity = a => a * scale;
    static assert(__traits(isSame, Alias!edentity, edentity)); // fails in
dmd-nightly
}

Mir Algorithm uses this technique a lot to reduce template bloat. It does not
compiles with dmd-nightly now,
see CI https://travis-ci.org/libmir/mir-algorithm/jobs/339855290

--


More information about the Digitalmars-d-bugs mailing list