[Issue 22227] New: `if (scope f = x())` and `while (scope f = x())` do not parse

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Aug 20 11:37:50 UTC 2021


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

          Issue ID: 22227
           Summary: `if (scope f = x())` and `while (scope f = x())` do
                    not parse
           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: pro.mathias.lang at gmail.com

```
void main ()
{
        if (scope foo = bar())
            assert(0);
}
int* bar () { return null; }
```

```
void main ()
{
        while (scope foo = bar())
            assert(0);
}
int* bar () { return null; }
```

Those two snippets should compile.

--


More information about the Digitalmars-d-bugs mailing list