www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 24525] New: auto ref lambda exp not parsed if used as

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

          Issue ID: 24525
           Summary: auto ref lambda exp not parsed if used as left-most
                    expression in a expression statement
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: b2.temp gmx.com



```d
void main()
{
    int a;
    (auto ref () {return a;}()) = 0; // OK
    auto ref () {return a;}() = 0;   // NG
}  
```



(many parser errors)



- Only observed for the 3rd rule
(https://dlang.org/spec/expression.html#function_literals).
- Must be that the parser takes the path of a declaration,

--
Apr 27