Third and Hopefully Last Draft: Primary Type Syntax

Quirin Schroll qs.il.paperinik at gmail.com
Tue Sep 24 20:52:45 UTC 2024


On Monday, 23 September 2024 at 19:03:47 UTC, Quirin Schroll 
wrote:
> I’ll commit my stuff probably tomorrow. I can’t do it now, 
> unfortunately.

Done. And I updated the DIP draft to include the new Maximum 
Munch exceptions.

I did everything as suggested in my post, except for the 
anonymous class stuff. There, I was mistaken. The constructor 
arguments go first, then the base class / interfaces follow:
```
new class ConstructorArgs? AnonBaseClassList? AggregateBody
```

This means there is no real issue. If someone writes `new class 
(Object)`, that’s a compile error today (if `Object` refers to a 
type, which it usually does) as parsing takes `(Object)` as the 
argument list, and it will stay one. Someone who wants to 
surround a the first base class / interface with parentheses has 
to use an explicit empty argument list, e.g. `new class () 
(Object) {}`.

----

Please review the latest draft 
[here](https://forum.dlang.org/post/cekqyahwnumvesppxsfs@forum.dlang.org).


More information about the dip.development mailing list