[Issue 24525] New: auto ref lambda exp not parsed if used as left-most expression in a expression statement
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Apr 28 00:18:12 UTC 2024
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 at puremagic.com
Reporter: b2.temp at gmx.com
## test case
```d
void main()
{
int a;
(auto ref () {return a;}()) = 0; // OK
auto ref () {return a;}() = 0; // NG
}
```
## output
(many parser errors)
## notes
- 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,
--
More information about the Digitalmars-d-bugs
mailing list