[Issue 20896] New: this.__lambda2 has no value when trying to evaluate length of AliasSeq

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jun 5 08:43:05 UTC 2020


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

          Issue ID: 20896
           Summary: this.__lambda2 has no value when trying to evaluate
                    length of AliasSeq
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: simen.kjaras at gmail.com

Just referring to a template parameter list containing a lambda can cause a
compile error:

struct S {
    int i = bug!(a => "b");
}

auto bug(fns...)() {
    return fns.length; // this.__lambda2 has no value
}

Moving the assignment outside of S makes the error go away, so it might be DMD
wants it to have a context pointer, which is unnecessary in this case.

--


More information about the Digitalmars-d-bugs mailing list