www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22217] New: Can't use redundant parens around function

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

          Issue ID: 22217
           Summary: Can't use redundant parens around function
           Product: D
           Version: D2
          Hardware: x86
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: Ajieskola gmail.com

```
int f(int x){return x+5;}
auto gVar= (f)(5);
```

results in `Error: C style cast illegal, use cast(f)5`.

This should parse as a call of `f` with argument `5`, not as a cast attempt.

--
Aug 16