[Issue 16001] New: Lambda syntax: forbid use with FunctionLiteralBody: (x) => {assert(x);}

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat May 7 09:28:20 PDT 2016


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

          Issue ID: 16001
           Summary: Lambda syntax: forbid use with FunctionLiteralBody:
                    (x) => {assert(x);}
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: sigod.mail at gmail.com

As discussed here:
https://forum.dlang.org/post/thgyqyarccinzuqhcjtf@forum.dlang.org

It's very common for people from other languages to write something like

    list.each!(x => { /* use x */ });

Which, of course, doesn't work as expected.

--


More information about the Digitalmars-d-bugs mailing list