www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22338] New: Parser rejects basic types in UDAs

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

          Issue ID: 22338
           Summary: Parser rejects basic types in UDAs
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: pro.mathias.lang gmail.com

```
 string  int
void main () {}
```

Returns:
```
onlineapp.d(1,10): Error: ` identifier` or ` (ArgumentList)` expected, not
` int`
onlineapp.d(2,1): Error: no identifier for declarator `int`
dmd failed with exit code 1.
```

However the following compiles just fine:
```
alias SillyParser = int;

 string  SillyParser
void main ()
{
}
```

Tested with DMD v2.097.2

--
Sep 27 2021