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

          Issue ID: 21377
           Summary: Unclear error message "delegate __lambda cannot be
                    struct members"
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nob...@puremagic.com
          Reporter: bradley.cha...@gmail.com

The following code produces an error (possible bug?) with a very confusing and
unclear message:

struct S
{
    bool delegate(string) f;
}

@S(str => true) // VALID
int a;

S s = S(str => true); // VALID

struct S2
{
    @S(str => false) // INVALID
    int a;
}

// Error: delegate onlineapp.S2.__lambda2 cannot be struct members

--

Reply via email to